mirror of https://github.com/apache/activemq.git
https://issues.apache.org/jira/browse/AMQ-5431 - prevent NPE when a Detach frame is received for a
link that didn't get as far as setting a context during creation before being detached/closed
This commit is contained in:
parent
08b1bedc6d
commit
5cd56e7fb1
|
@ -351,7 +351,10 @@ class AmqpProtocolConverter implements IAmqpProtocolConverter {
|
|||
if (remoteState == EndpointState.ACTIVE) {
|
||||
onLinkOpen(link);
|
||||
} else if (remoteState == EndpointState.CLOSED) {
|
||||
((AmqpDeliveryListener) link.getContext()).onClose();
|
||||
AmqpDeliveryListener context = (AmqpDeliveryListener) link.getContext();
|
||||
if (context != null) {
|
||||
context.onClose();
|
||||
}
|
||||
link.close();
|
||||
link.free();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue