DaanHoogland commented on code in PR #6879:
URL: https://github.com/apache/cloudstack/pull/6879#discussion_r1018795681
##########
server/src/main/java/com/cloud/tags/TaggedResourceManagerImpl.java:
##########
@@ -318,7 +318,11 @@ public Map<String, String>
getTagsFromResource(ResourceObjectType type, long res
private void informStoragePoolForVmTags(long vmId, String key, String
value) {
List<VolumeVO> volumeVos = volumeDao.findByInstance(vmId);
for (VolumeVO volume : volumeVos) {
- DataStore dataStore =
dataStoreMgr.getDataStore(volume.getPoolId(), DataStoreRole.Primary);
+ Long poolId = volume.getPoolId();
+ if (poolId == null) {
+ continue;
+ }
+ DataStore dataStore = dataStoreMgr.getDataStore(poolId,
DataStoreRole.Primary);
if (dataStore == null || !(dataStore.getDriver() instanceof
PrimaryDataStoreDriver)) {
continue;
}
Review Comment:
yeah, it was just an example. Your solution is addequate.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]