From 6b3b3b74265c97c33186440d10b97822adc662c7 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:54:38 -0700 Subject: [PATCH] Fix of NPE when non chunked large variable is created --- .../org/jboss/netty/handler/codec/http/MixedAttribute.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/jboss/netty/handler/codec/http/MixedAttribute.java b/src/main/java/org/jboss/netty/handler/codec/http/MixedAttribute.java index 62a637015c..4bad8f9c03 100644 --- a/src/main/java/org/jboss/netty/handler/codec/http/MixedAttribute.java +++ b/src/main/java/org/jboss/netty/handler/codec/http/MixedAttribute.java @@ -73,8 +73,10 @@ public class MixedAttribute implements Attribute { if (attribute.length() + buffer.readableBytes() > limitSize) { DiskAttribute diskAttribute = new DiskAttribute(attribute .getName()); - diskAttribute.addContent(((MemoryAttribute) attribute) + if (((MemoryAttribute) attribute).getChannelBuffer() != null) { + diskAttribute.addContent(((MemoryAttribute) attribute) .getChannelBuffer(), last); + } attribute = diskAttribute; } }