Fixed toString() NPE in case the stream is null.

This commit is contained in:
Simone Bordet 2016-05-25 18:18:50 +02:00
parent b3eee7884b
commit 6bf3607444
1 changed files with 5 additions and 1 deletions

View File

@ -280,6 +280,10 @@ public class HttpChannelOverHTTP2 extends HttpChannel
@Override
public String toString()
{
return String.format("%s#%d", super.toString(), getStream().getId());
IStream stream = getStream();
long streamId = -1;
if (stream != null)
streamId = stream.getId();
return String.format("%s#%d", super.toString(), getStream() == null ? -1 : streamId);
}
}