From d2ffd5d7ed3f7638525d325f0d7e97d650e1e715 Mon Sep 17 00:00:00 2001 From: Chia-Ping Tsai Date: Wed, 13 Dec 2017 22:31:04 +0800 Subject: [PATCH] HBASE-19484 (addendum) NPE in ExtendedCell#write --- .../src/main/java/org/apache/hadoop/hbase/ExtendedCell.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/ExtendedCell.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/ExtendedCell.java index d4913262ac8..36b07a81b7a 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/ExtendedCell.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/ExtendedCell.java @@ -53,8 +53,10 @@ public interface ExtendedCell extends RawCell, HeapSize, Cloneable { // Key PrivateCellUtil.writeFlatKey(this, out); - // Value - out.write(getValueArray(), getValueOffset(), getValueLength()); + if (getValueLength() > 0) { + // Value + out.write(getValueArray(), getValueOffset(), getValueLength()); + } // Tags length and tags byte array if (withTags && getTagsLength() > 0) {