diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Result.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Result.java index 138432aada32..1ef1633d193e 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Result.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Result.java @@ -913,19 +913,16 @@ public CellScanner cellScanner() { @Override public Cell current() { - if (isEmpty() + if (cells == null || cellScannerIndex == INITIAL_CELLSCANNER_INDEX - || cellScannerIndex >= cells.length) { + || cellScannerIndex >= cells.length) return null; - } return this.cells[cellScannerIndex]; } @Override public boolean advance() { - if (isEmpty()) { - return false; - } + if (cells == null) return false; cellScannerIndex++; if (cellScannerIndex < this.cells.length) { return true;