This is an automated email from the ASF dual-hosted git repository.

icodening pushed a commit to branch 3.2
in repository https://gitbox.apache.org/repos/asf/dubbo.git


The following commit(s) were added to refs/heads/3.2 by this push:
     new 95439fb23c fix(3.2): triple AbstractServerCallListener NPE (#14009)
95439fb23c is described below

commit 95439fb23ce9855197843e5f2ee02c4713f09846
Author: caoyanan666 <[email protected]>
AuthorDate: Sun Apr 7 14:56:35 2024 +0800

    fix(3.2): triple AbstractServerCallListener NPE (#14009)
    
    * fix NPE
    
    * Optimize the handling of exceptions in response
    
    ---------
    
    Co-authored-by: caoyanan <[email protected]>
---
 .../dubbo/rpc/protocol/tri/call/AbstractServerCallListener.java   | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git 
a/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/call/AbstractServerCallListener.java
 
b/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/call/AbstractServerCallListener.java
index 7fa838d8d7..879cf44e10 100644
--- 
a/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/call/AbstractServerCallListener.java
+++ 
b/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/call/AbstractServerCallListener.java
@@ -62,14 +62,18 @@ public abstract class AbstractServerCallListener implements 
AbstractServerCall.L
         final long stInMillis = System.currentTimeMillis();
         try {
             final Result response = invoker.invoke(invocation);
+            if (response.hasException()) {
+                doOnResponseHasException(response.getException());
+                return;
+            }
             response.whenCompleteWithContext((r, t) -> {
                 
responseObserver.setResponseAttachments(response.getObjectAttachments());
                 if (t != null) {
                     responseObserver.onError(t);
                     return;
                 }
-                if (response.hasException()) {
-                    doOnResponseHasException(response.getException());
+                if (r.hasException()) {
+                    doOnResponseHasException(r.getException());
                     return;
                 }
                 final long cost = System.currentTimeMillis() - stInMillis;

Reply via email to