fixed NPE, secondary storage VM host may not exist even the secondary storage VM is running

This commit is contained in:
anthony 2011-07-26 17:39:24 -07:00
parent bad0f77659
commit 4c8f5e0591

View File

@ -391,6 +391,9 @@ public class SecondaryStorageManagerImpl implements SecondaryStorageVmManager, V
}
String instanceName = ssVm.getInstanceName();
HostVO host = _hostDao.findByName(instanceName);
if ( host == null ) {
continue;
}
Answer answer = _agentMgr.easySend(host.getId(), thiscpc);
if (answer != null && answer.getResult()) {
if (s_logger.isDebugEnabled()) {