Skip to content

Commit f652ad0

Browse files
authored
extra null guard (#10264)
1 parent 0a77eb7 commit f652ad0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

engine/orchestration/src/main/java/com/cloud/agent/manager/AgentManagerImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,11 +586,11 @@ protected AgentAttache notifyMonitorsOfConnection(final AgentAttache attache, fi
586586
}
587587
} catch (final HypervisorVersionChangedException hvce) {
588588
handleDisconnectWithoutInvestigation(attache, Event.ShutdownRequested, true, true);
589-
throw new CloudRuntimeException("Unable to connect " + attache.getId(), hvce);
589+
throw new CloudRuntimeException("Unable to connect " + (attache == null ? "<unknown agent>" : attache.getId()), hvce);
590590
} catch (final Exception e) {
591591
s_logger.error("Monitor " + monitor.second().getClass().getSimpleName() + " says there is an error in the connect process for " + hostId + " due to " + e.getMessage(), e);
592592
handleDisconnectWithoutInvestigation(attache, Event.AgentDisconnected, true, true);
593-
throw new CloudRuntimeException("Unable to connect " + attache.getId(), e);
593+
throw new CloudRuntimeException("Unable to connect " + (attache == null ? "<unknown agent>" : attache.getId()), e);
594594
}
595595
}
596596
}

0 commit comments

Comments
 (0)