Only set capabilities if not null

This commit is contained in:
Manfred Karrer 2019-04-16 22:48:32 -05:00
parent b0fef9819b
commit 7e0a7a4f02
No known key found for this signature in database
GPG Key ID: 401250966A6B2C46

View File

@ -754,8 +754,12 @@ public class Connection implements HasCapabilities, Runnable, MessageListener {
return;
}
if (networkEnvelope instanceof SupportedCapabilitiesMessage)
capabilities.set(((SupportedCapabilitiesMessage) networkEnvelope).getSupportedCapabilities());
if (networkEnvelope instanceof SupportedCapabilitiesMessage) {
Capabilities supportedCapabilities = ((SupportedCapabilitiesMessage) networkEnvelope).getSupportedCapabilities();
if (supportedCapabilities != null) {
capabilities.set(supportedCapabilities);
}
}
if (networkEnvelope instanceof CloseConnectionMessage) {
// If we get a CloseConnectionMessage we shut down