Bug 8102: CheckSshAnswer could be null

This commit is contained in:
Kelven Yang 2011-01-25 16:42:05 -08:00
parent 2b646f3ee0
commit a56e5ace88
1 changed files with 5 additions and 2 deletions

View File

@ -1537,8 +1537,11 @@ public class ConsoleProxyManagerImpl implements ConsoleProxyManager, ConsoleProx
@Override
public boolean finalizeStart(VirtualMachineProfile<ConsoleProxyVO> profile, long hostId, Commands cmds, ReservationContext context) {
CheckSshAnswer answer = (CheckSshAnswer)cmds.getAnswer("checkSsh");
if (!answer.getResult()) {
s_logger.warn("Unable to ssh to the VM: " + answer.getDetails());
if (answer == null || !answer.getResult()) {
if(answer != null)
s_logger.warn("Unable to ssh to the VM: " + answer.getDetails());
else
s_logger.warn("Unable to ssh to the VM: null answer");
return false;
}