Guarded against NPE.

This commit is contained in:
Simone Bordet 2015-08-20 16:31:09 +02:00
parent 9b6ba2477c
commit fd335d6c3e

View File

@ -115,6 +115,8 @@ public class BufferingFlowControlStrategy extends AbstractFlowControlStrategy
else else
{ {
AtomicInteger streamLevel = streamLevels.get(stream); AtomicInteger streamLevel = streamLevels.get(stream);
if (streamLevel != null)
{
level = streamLevel.addAndGet(length); level = streamLevel.addAndGet(length);
maxLevel = (int)(getInitialStreamRecvWindow() * bufferRatio); maxLevel = (int)(getInitialStreamRecvWindow() * bufferRatio);
if (level > maxLevel) if (level > maxLevel)
@ -136,6 +138,7 @@ public class BufferingFlowControlStrategy extends AbstractFlowControlStrategy
} }
} }
} }
}
if (windowFrame != null) if (windowFrame != null)
session.frames(stream, Callback.NOOP, windowFrame, windowFrames); session.frames(stream, Callback.NOOP, windowFrame, windowFrames);