clebertsuconic commented on code in PR #4932:
URL: https://github.com/apache/activemq-artemis/pull/4932#discussion_r1602304910


##########
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPLargeMessageWriter.java:
##########
@@ -170,16 +170,26 @@ private void resume() {
    }
 
    private void tryDelivering() {
+
+      final Delivery localDelivery = delivery;
+      final MessageReference localReference = reference;
+      final LargeBodyReader localBodyReader = largeBodyReader;
+
+      if (localDelivery == null || localReference == null || localBodyReader 
== null) {
+         logger.debug("Write got closed before tryDelivering was called");
+         return;
+      }

Review Comment:
   If I checked just closed, I guess you could still hit the NPE. You could 
check the closed variable.. but I don't know how to get rid of the possible NPE 
here without adding synchronization.
   
   The NPE will be just an annoyance since it's closing anyway.. but I was 
asked to mitigate the NPE.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to