CLOUDSTACK-9055: fix NPE in updating Redundant State of VPC networks

This commit is contained in:
Wei Zhou 2015-11-11 12:18:54 +01:00
parent f6db0a2a49
commit 66fc7c62f4

View File

@ -1013,10 +1013,12 @@ Configurable, StateListener<State, VirtualMachine.Event, VirtualMachine> {
s_logger.warn("Unable to update router " + router.getHostName() + "'s status");
}
RedundantState state = RedundantState.UNKNOWN;
if (answer != null && answer.getResult()) {
state = answer.getState();
} else {
s_logger.info("Agent response doesn't seem to be correct ==> " + answer.getResult());
if (answer != null) {
if (answer.getResult()) {
state = answer.getState();
} else {
s_logger.info("Agent response doesn't seem to be correct ==> " + answer.getResult());
}
}
router.setRedundantState(state);
updated = true;