CLOUDSTACK-7563: Fix potential NPE in checking answer

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit d42e3df9cf43b0ad46d406c6ab5b1d8c811d0239)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Rohit Yadav 2014-12-02 16:14:29 +05:30
parent 0407fb334f
commit f40e31e061

View File

@ -1254,7 +1254,8 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
_resourceMgr.updateGPUDetails(vm.getHostId(), gpuDevice.getGroupDetails());
}
if (answer == null || !answer.getResult()) {
s_logger.debug("Unable to stop VM due to " + answer.getDetails());
String details = (answer != null) ? answer.getDetails() : "null answer returned";
s_logger.debug("Unable to stop VM due to " + details);
return false;
}