Prevented NPE in abort().

This commit is contained in:
Simone Bordet 2015-03-16 08:17:25 +01:00
parent 4f0c63734c
commit 81f29576e6
1 changed files with 4 additions and 2 deletions

View File

@ -205,9 +205,11 @@ public class HttpTransportOverHTTP2 implements HttpTransport
@Override
public void abort(Throwable failure)
{
IStream stream = this.stream;
if (LOG.isDebugEnabled())
LOG.debug("HTTP2 Response #{} aborted", stream.getId());
stream.reset(new ResetFrame(stream.getId(), ErrorCode.INTERNAL_ERROR.code), Callback.Adapter.INSTANCE);
LOG.debug("HTTP2 Response #{} aborted", stream == null ? -1 : stream.getId());
if (stream != null)
stream.reset(new ResetFrame(stream.getId(), ErrorCode.INTERNAL_ERROR.code), Callback.Adapter.INSTANCE);
}
private class CommitCallback implements Callback