From d6ea072ccc75c42030a1b8a380d7bbf32b6e1e52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Br=C3=A9gier?= Date: Sat, 16 Jul 2011 11:58:40 -0700 Subject: [PATCH] Fix NPE when non chunked message with a large variable --- .../org/jboss/netty/handler/codec/http/MixedFileUpload.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/jboss/netty/handler/codec/http/MixedFileUpload.java b/src/main/java/org/jboss/netty/handler/codec/http/MixedFileUpload.java index 91e0179547..51994ff267 100644 --- a/src/main/java/org/jboss/netty/handler/codec/http/MixedFileUpload.java +++ b/src/main/java/org/jboss/netty/handler/codec/http/MixedFileUpload.java @@ -62,8 +62,10 @@ public class MixedFileUpload implements FileUpload { .getContentType(), fileUpload .getContentTransferEncoding(), fileUpload.getCharset(), definedSize); - diskFileUpload.addContent(((MemoryFileUpload) fileUpload) + if (((MemoryFileUpload) fileUpload).getChannelBuffer() != null){ + diskFileUpload.addContent(((MemoryFileUpload) fileUpload) .getChannelBuffer(), last); + } fileUpload = diskFileUpload; } }