Skip to content

Commit f226bd7

Browse files
DaanHooglanddhslove
authored andcommitted
extra null guard (apache#10264)
1 parent c4b7bec commit f226bd7

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
@@ -635,11 +635,11 @@ protected AgentAttache notifyMonitorsOfConnection(final AgentAttache attache, fi
635635
}
636636
} catch (final HypervisorVersionChangedException hvce) {
637637
handleDisconnectWithoutInvestigation(attache, Event.ShutdownRequested, true, true);
638-
throw new CloudRuntimeException("Unable to connect " + attache.getId(), hvce);
638+
throw new CloudRuntimeException("Unable to connect " + (attache == null ? "<unknown agent>" : attache.getId()), hvce);
639639
} catch (final Exception e) {
640640
logger.error("Monitor " + monitor.second().getClass().getSimpleName() + " says there is an error in the connect process for " + hostId + " due to " + e.getMessage(), e);
641641
handleDisconnectWithoutInvestigation(attache, Event.AgentDisconnected, true, true);
642-
throw new CloudRuntimeException("Unable to connect " + attache.getId(), e);
642+
throw new CloudRuntimeException("Unable to connect " + (attache == null ? "<unknown agent>" : attache.getId()), e);
643643
}
644644
}
645645
}

0 commit comments

Comments
 (0)