sureshanaparti commented on a change in pull request #4428:
URL: https://github.com/apache/cloudstack/pull/4428#discussion_r525910026



##########
File path: 
engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java
##########
@@ -1672,10 +1672,13 @@ protected boolean sendStop(final VirtualMachineGuru 
guru, final VirtualMachinePr
                 }
 
                 guru.finalizeStop(profile, answer);
+
+                final UserVmVO userVm = _userVmDao.findById(vm.getId());
                 if (vm.getType() == VirtualMachine.Type.User) {
-                    final UserVmVO userVm = _userVmDao.findById(vm.getId());
-                    userVm.setPowerState(PowerState.PowerOff);
-                    _userVmDao.update(userVm.getId(), userVm);
+                    if (userVm != null){
+                        userVm.setPowerState(PowerState.PowerOff);
+                        _userVmDao.update(userVm.getId(), userVm);

Review comment:
       @Spaceman1984 these changes are part of your fix?




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to