diff options
author | Shohei Kamimori <jyane.kstm@gmail.com> | 2018-01-18 08:47:45 +0900 |
---|---|---|
committer | Kun Zhang <zhangkun83@users.noreply.github.com> | 2018-01-17 15:47:45 -0800 |
commit | b5ae13405f3eba60fae195253a4dab5857dadf97 (patch) | |
tree | 31d7a97b57437c29ac900586b25286926025673a /netty | |
parent | c51b9271fbe4cb5c21c6341d5f076a22409a7298 (diff) | |
download | grpc-grpc-java-b5ae13405f3eba60fae195253a4dab5857dadf97.tar.gz |
netty: avoid unintentionally NullPointerException (#3932)
Diffstat (limited to 'netty')
-rw-r--r-- | netty/src/main/java/io/grpc/netty/NettyServerHandler.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/netty/src/main/java/io/grpc/netty/NettyServerHandler.java b/netty/src/main/java/io/grpc/netty/NettyServerHandler.java index 7e90e86b3..223c5e311 100644 --- a/netty/src/main/java/io/grpc/netty/NettyServerHandler.java +++ b/netty/src/main/java/io/grpc/netty/NettyServerHandler.java @@ -31,6 +31,7 @@ import static io.netty.handler.codec.http2.DefaultHttp2LocalFlowController.DEFAU import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; +import com.google.common.base.Strings; import io.grpc.Attributes; import io.grpc.InternalMetadata; import io.grpc.InternalStatus; @@ -710,7 +711,7 @@ class NettyServerHandler extends AbstractNettyHandler { private Http2Exception newStreamException(int streamId, Throwable cause) { return Http2Exception.streamError( - streamId, Http2Error.INTERNAL_ERROR, cause, cause.getMessage()); + streamId, Http2Error.INTERNAL_ERROR, cause, Strings.nullToEmpty(cause.getMessage())); } private class FrameListener extends Http2FrameAdapter { |