Skip to content

Commit b5ae134

Browse files
jyanezhangkun83
authored andcommitted
netty: avoid unintentionally NullPointerException (grpc#3932)
1 parent c51b927 commit b5ae134

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

netty/src/main/java/io/grpc/netty/NettyServerHandler.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
import com.google.common.annotations.VisibleForTesting;
3333
import com.google.common.base.Preconditions;
34+
import com.google.common.base.Strings;
3435
import io.grpc.Attributes;
3536
import io.grpc.InternalMetadata;
3637
import io.grpc.InternalStatus;
@@ -710,7 +711,7 @@ private NettyServerStream.TransportState serverStream(Http2Stream stream) {
710711

711712
private Http2Exception newStreamException(int streamId, Throwable cause) {
712713
return Http2Exception.streamError(
713-
streamId, Http2Error.INTERNAL_ERROR, cause, cause.getMessage());
714+
streamId, Http2Error.INTERNAL_ERROR, cause, Strings.nullToEmpty(cause.getMessage()));
714715
}
715716

716717
private class FrameListener extends Http2FrameAdapter {

0 commit comments

Comments
 (0)