cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbros...@apache.org
Subject cassandra git commit: guard against npe if no thrift supercolumn data patch by dbrosius, reviewed by slebresne for CASSANDRA-10942
Date Mon, 28 Dec 2015 13:23:34 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-3.0 13daf89da -> 21191e6ef


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/cassandra-3.0
Commit: 21191e6efa8a31292791717295f460faacec54ae
Parents: 13daf89
Author: Dave Brosius <dbrosius@mebigfatguy.com>
Authored: Mon Dec 28 08:22:31 2015 -0500
Committer: Dave Brosius <dbrosius@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())
             {


Mime
View raw message