You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by gi...@git.apache.org on 2017/07/04 09:08:13 UTC

[GitHub] koushik-das commented on a change in pull request #2081: CLOUDSTACK-9894 Separate creation and backup operations for a volume snapshot

koushik-das commented on a change in pull request #2081: CLOUDSTACK-9894 Separate creation and backup operations for a volume snapshot
URL: https://github.com/apache/cloudstack/pull/2081#discussion_r125419150
 
 

 ##########
 File path: server/src/com/cloud/vm/UserVmManagerImpl.java
 ##########
 @@ -2655,10 +2656,16 @@ public UserVm destroyVm(DestroyVMCmd cmd) throws ResourceUnavailableException, C
         if (expunge && !_accountMgr.isAdmin(ctx.getCallingAccount().getId()) && !AllowUserExpungeRecoverVm.valueIn(cmd.getEntityOwnerId())) {
             throw new PermissionDeniedException("Parameter " + ApiConstants.EXPUNGE + " can be passed by Admin only. Or when the allow.user.expunge.recover.vm key is set.");
         }
+        // check if VM exists
+        UserVmVO vm = _vmDao.findById(vmId);
 
 Review comment:
   Simply calling findById() doesn't imply VM exists, you need to check that the return value is not null.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services