aboutsummaryrefslogtreecommitdiff
path: root/netty
diff options
context:
space:
mode:
authorShohei Kamimori <jyane.kstm@gmail.com>2018-01-18 08:47:45 +0900
committerKun Zhang <zhangkun83@users.noreply.github.com>2018-01-17 15:47:45 -0800
commitb5ae13405f3eba60fae195253a4dab5857dadf97 (patch)
tree31d7a97b57437c29ac900586b25286926025673a /netty
parentc51b9271fbe4cb5c21c6341d5f076a22409a7298 (diff)
downloadgrpc-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.java3
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 {