bug 10994: Fixed NPE in destroySystemVm api

status 10994: resolved fixed
This commit is contained in:
alena 2011-08-05 12:45:24 -07:00
parent ee62361250
commit 6eacc11222

View File

@ -1174,7 +1174,10 @@ public class ApiResponseHelper implements ResponseGenerator {
// for console proxies, add the active sessions
if (vm.getType() == Type.ConsoleProxy) {
ConsoleProxyVO proxy = ApiDBUtils.findConsoleProxy(vm.getId());
vmResponse.setActiveViewerSessions(proxy.getActiveSession());
//proxy can be already destroyed
if (proxy != null) {
vmResponse.setActiveViewerSessions(proxy.getActiveSession());
}
}
DataCenter zone = ApiDBUtils.findZoneById(vm.getDataCenterIdToDeployIn());