You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2021/08/24 07:11:23 UTC

[GitHub] [cloudstack] rhtyd commented on a change in pull request #5358: Fix potential NullPointerException in findStoragePool (VolumeOrchestrator)

rhtyd commented on a change in pull request #5358:
URL: https://github.com/apache/cloudstack/pull/5358#discussion_r694564087



##########
File path: engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
##########
@@ -311,7 +311,10 @@ public VolumeVO allocateDuplicateVolumeVO(Volume oldVol, Long templateId) {
     }
 
     private Optional<StoragePool> getPreferredStoragePool(List<StoragePool> poolList, VirtualMachine vm) {
-        String accountStoragePoolUuid = StorageManager.PreferredStoragePool.valueIn(vm.getAccountId());
+        String accountStoragePoolUuid = null;
+        if (vm != null) {
+            accountStoragePoolUuid = StorageManager.PreferredStoragePool.valueIn(vm.getAccountId());

Review comment:
       cc @nvazquez @davidjumani @sureshanaparti @weizhouapache - this needs validation, can you check what caused the regression and whether this fix actually fixes the regression or could potentially cause another one?




-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org