From 14e24c97aab634d532ec12320bc45eb8917ce47a Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Tue, 5 Feb 2013 18:07:23 -0700 Subject: [PATCH] 400040 - NullPointerException in HttpGenerator.prepareBuffers + Adding safety check on _header use --- .../src/main/java/org/eclipse/jetty/http/HttpGenerator.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/HttpGenerator.java b/jetty-http/src/main/java/org/eclipse/jetty/http/HttpGenerator.java index 6f0807ae721..cd3edea4cba 100644 --- a/jetty-http/src/main/java/org/eclipse/jetty/http/HttpGenerator.java +++ b/jetty-http/src/main/java/org/eclipse/jetty/http/HttpGenerator.java @@ -1017,7 +1017,7 @@ public class HttpGenerator extends AbstractGenerator { if (_needCRLF) { - if (_buffer == null && _header.space() >= 2) + if (_buffer == null && _header != null && _header.space() >= 2) { _header.put(HttpTokens.CRLF); _needCRLF = false; @@ -1031,7 +1031,7 @@ public class HttpGenerator extends AbstractGenerator if (!_needCRLF && _needEOC) { - if (_buffer == null && _header.space() >= LAST_CHUNK.length) + if (_buffer == null && _header != null && _header.space() >= LAST_CHUNK.length) { if (!_head) {