Fixes #4082 - Debug logging causes NullPointerException in client.

Using BufferUtil to guard against NPEs.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
Simone Bordet 2019-09-12 12:14:15 +02:00
parent 43e10f8a5e
commit 8c1e0b0714
1 changed files with 2 additions and 2 deletions

View File

@ -173,10 +173,10 @@ public class HttpReceiverOverHTTP extends HttpReceiver implements HttpParser.Res
boolean complete = this.complete;
this.complete = false;
if (LOG.isDebugEnabled())
LOG.debug("Parsed {}, remaining {} {}", handle, buffer.remaining(), parser);
LOG.debug("Parsed {}, remaining {} {}", handle, BufferUtil.length(buffer), parser);
if (handle)
return true;
if (!buffer.hasRemaining())
if (!BufferUtil.hasContent(buffer))
return false;
if (complete)
{