You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/12/01 07:14:49 UTC

[GitHub] [pulsar] Jason918 commented on a change in pull request #12396: Fix NPE when create OpEntry

Jason918 commented on a change in pull request #12396:
URL: https://github.com/apache/pulsar/pull/12396#discussion_r759910077



##########
File path: managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/OpReadEntry.java
##########
@@ -58,6 +57,11 @@ public static OpReadEntry create(ManagedCursorImpl cursor, PositionImpl readPosi
         }
         op.maxPosition = maxPosition;
         op.ctx = ctx;
+        PositionImpl position = cursor.ledger.startReadOperationOnLedger(readPositionRef, op);
+        if (position == null) {
+            return null;

Review comment:
       We can recycle this OpReadEntry if we return null.




-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org