You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by gu...@apache.org on 2022/02/18 08:57:37 UTC

[dubbo] branch 3.0 updated: Do not deserialize if data is null (#9699)

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

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


The following commit(s) were added to refs/heads/3.0 by this push:
     new b48de77  Do not deserialize if data is null (#9699)
b48de77 is described below

commit b48de772159933dac47376b6c0a1e52342300d99
Author: GuoHao <gu...@gmail.com>
AuthorDate: Fri Feb 18 16:57:06 2022 +0800

    Do not deserialize if data is null (#9699)
---
 .../java/org/apache/dubbo/rpc/protocol/tri/UnaryClientStream.java   | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/UnaryClientStream.java b/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/UnaryClientStream.java
index a0db29c..2470b00 100644
--- a/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/UnaryClientStream.java
+++ b/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/UnaryClientStream.java
@@ -50,6 +50,12 @@ public class UnaryClientStream extends AbstractClientStream implements Stream {
                     try {
                         AppResponse result;
                         if (!Void.TYPE.equals(getMethodDescriptor().getReturnClass())) {
+                            if (getData() == null) {
+                                final GrpcStatus clientStatus = GrpcStatus.fromCode(GrpcStatus.Code.INTERNAL)
+                                    .withDescription("Missing response data");
+                                onError(clientStatus);
+                                return;
+                            }
                             final Object resp = deserializeResponse(getData());
                             result = new AppResponse(resp);
                         } else {