Skip to content

Commit

Permalink
netty: avoid unintentionally NullPointerException (#3932)
Browse files Browse the repository at this point in the history
  • Loading branch information
jyane authored and zhangkun83 committed Jan 17, 2018
1 parent c51b927 commit b5ae134
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion netty/src/main/java/io/grpc/netty/NettyServerHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

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;
Expand Down Expand Up @@ -710,7 +711,7 @@ private NettyServerStream.TransportState serverStream(Http2Stream stream) {

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 {
Expand Down

0 comments on commit b5ae134

Please sign in to comment.