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: [email protected]

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

Reply via email to