Fix of NPE when non chunked large variable is created

This commit is contained in:
Frédéric Brégier 2011-07-16 11:54:38 -07:00 committed by Trustin Lee
parent dbb2392034
commit 6b3b3b7426

View File

@ -73,8 +73,10 @@ public class MixedAttribute implements Attribute {
if (attribute.length() + buffer.readableBytes() > limitSize) { if (attribute.length() + buffer.readableBytes() > limitSize) {
DiskAttribute diskAttribute = new DiskAttribute(attribute DiskAttribute diskAttribute = new DiskAttribute(attribute
.getName()); .getName());
if (((MemoryAttribute) attribute).getChannelBuffer() != null) {
diskAttribute.addContent(((MemoryAttribute) attribute) diskAttribute.addContent(((MemoryAttribute) attribute)
.getChannelBuffer(), last); .getChannelBuffer(), last);
}
attribute = diskAttribute; attribute = diskAttribute;
} }
} }