extra null guard (#10264)

This commit is contained in:
dahn 2025-01-27 14:14:31 +01:00 committed by GitHub
parent 0a77eb7f85
commit f652ad0d98
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -586,11 +586,11 @@ public class AgentManagerImpl extends ManagerBase implements AgentManager, Handl
}
} catch (final HypervisorVersionChangedException hvce) {
handleDisconnectWithoutInvestigation(attache, Event.ShutdownRequested, true, true);
throw new CloudRuntimeException("Unable to connect " + attache.getId(), hvce);
throw new CloudRuntimeException("Unable to connect " + (attache == null ? "<unknown agent>" : attache.getId()), hvce);
} catch (final Exception e) {
s_logger.error("Monitor " + monitor.second().getClass().getSimpleName() + " says there is an error in the connect process for " + hostId + " due to " + e.getMessage(), e);
handleDisconnectWithoutInvestigation(attache, Event.AgentDisconnected, true, true);
throw new CloudRuntimeException("Unable to connect " + attache.getId(), e);
throw new CloudRuntimeException("Unable to connect " + (attache == null ? "<unknown agent>" : attache.getId()), e);
}
}
}