Pearl1594 commented on code in PR #9113:
URL: https://github.com/apache/cloudstack/pull/9113#discussion_r1616793731


##########
server/src/main/java/com/cloud/vm/UserVmManagerImpl.java:
##########
@@ -7844,9 +7844,10 @@ public UserVm restoreVirtualMachine(final Account 
caller, final long vmId, final
             }
             vm.setPassword(password);
         }
+        UserVmDetailVO userVmPasswordDetail = 
userVmDetailsDao.findDetail(vm.getId(), VmDetailConstants.PASSWORD);
         if (needRestart) {
             try {
-                if (vm.getDetail(VmDetailConstants.PASSWORD) != null) {
+                if (Objects.nonNull(userVmPasswordDetail)) {

Review Comment:
   I believe that should work too. I'll check and update for simplicity.



-- 
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-unsubscr...@cloudstack.apache.org

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

Reply via email to