Repository: cassandra Updated Branches: refs/heads/trunk 6bd0f7ac1 -> bc6ea03d1
guard against npe if no thrift supercolumn data patch by dbrosius, reviewed by slebresne for CASSANDRA-10942 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/21191e6e Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/21191e6e Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/21191e6e Branch: refs/heads/trunk Commit: 21191e6efa8a31292791717295f460faacec54ae Parents: 13daf89 Author: Dave Brosius <dbros...@mebigfatguy.com> Authored: Mon Dec 28 08:22:31 2015 -0500 Committer: Dave Brosius <dbros...@mebigfatguy.com> Committed: Mon Dec 28 08:22:31 2015 -0500 ---------------------------------------------------------------------- .../apache/cassandra/thrift/ThriftResultsMerger.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/21191e6e/src/java/org/apache/cassandra/thrift/ThriftResultsMerger.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/thrift/ThriftResultsMerger.java b/src/java/org/apache/cassandra/thrift/ThriftResultsMerger.java index 14c0dca..ea3fa2f 100644 --- a/src/java/org/apache/cassandra/thrift/ThriftResultsMerger.java +++ b/src/java/org/apache/cassandra/thrift/ThriftResultsMerger.java @@ -234,9 +234,17 @@ public class ThriftResultsMerger extends Transformation<UnfilteredRowIterator> builder.newRow(row.clustering()); ComplexColumnData complexData = row.getComplexColumnData(superColumnMapColumn); - PeekingIterator<Cell> dynamicCells = Iterators.peekingIterator(complexData == null ? Collections.<Cell>emptyIterator() : complexData.iterator()); - - builder.addComplexDeletion(superColumnMapColumn, complexData.complexDeletion()); + + PeekingIterator<Cell> dynamicCells; + if (complexData == null) + { + dynamicCells = Iterators.peekingIterator(Collections.<Cell>emptyIterator()); + } + else + { + dynamicCells = Iterators.peekingIterator(complexData.iterator()); + builder.addComplexDeletion(superColumnMapColumn, complexData.complexDeletion()); + } while (staticCells.hasNext() && dynamicCells.hasNext()) {