Skip to content

Commit

Permalink
Check for null streams before attaching a "cause" property. Fixes #767.
Browse files Browse the repository at this point in the history
  • Loading branch information
jchambers committed May 9, 2020
1 parent 7a82a54 commit ace2c84
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,11 @@ public void onGoAwayReceived(final int lastStreamId, final long errorCode, final
@Override
protected void onStreamError(final ChannelHandlerContext context, final boolean isOutbound, final Throwable cause, final Http2Exception.StreamException streamException) {
final Http2Stream stream = this.connection().stream(streamException.streamId());
stream.setProperty(this.streamErrorCausePropertyKey, streamException);

// The affected stream may already be closed (or was never open in the first place)
if (stream != null) {
stream.setProperty(this.streamErrorCausePropertyKey, streamException);
}

super.onStreamError(context, isOutbound, cause, streamException);
}
Expand Down

0 comments on commit ace2c84

Please sign in to comment.