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 2022/04/08 16:22:14 UTC

[GitHub] [pulsar] poorbarcode commented on a diff in pull request #15090: [fix][broker] Fix npe in OpAddEntry#addComplete

poorbarcode commented on code in PR #15090:
URL: https://github.com/apache/pulsar/pull/15090#discussion_r846292223


##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/OpAddEntry.java:
##########
@@ -165,7 +165,7 @@ public void addComplete(int rc, final LedgerHandle lh, long entryId, Object ctx)
             return;
         }
 
-        if (ledger.getId() != lh.getId()) {
+        if (lh != null && ledger != null && ledger.getId() != lh.getId()) {

Review Comment:
   Field `ledgerId` of `LedgerHandle.java` is not wrap class, will not throw NullpointerException.
   
   Mabey `ledger` or `lh` is null ? 
   
   If ledger` is null, that is not a simple null-pointer problem, could you explain the case ?



-- 
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