jerrypeng commented on a change in pull request #1998: fix potential NPE when 
releasing entry that is null
URL: https://github.com/apache/bookkeeper/pull/1998#discussion_r268463303
 
 

 ##########
 File path: 
stream/distributedlog/core/src/main/java/org/apache/distributedlog/impl/logsegment/BKLogSegmentEntryReader.java
 ##########
 @@ -800,7 +800,9 @@ private void 
readEntriesFromReadAheadCache(PendingReadRequest nextRequest) {
                         return;
                     }
                 } finally {
-                    removedEntry.release();
+                    if (removedEntry != null) {
+                        removedEntry.release();
+                    }
 
 Review comment:
   will change

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to