gora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lewi...@apache.org
Subject gora git commit: GORA-462 Potential null dereference of serializer in CassandraSubColumn#getFieldValue()
Date Sun, 28 Feb 2016 22:10:06 GMT
Repository: gora
Updated Branches:
  refs/heads/master 4f98503c0 -> 3977e99b1


GORA-462 Potential null dereference of serializer in CassandraSubColumn#getFieldValue()


Project: http://git-wip-us.apache.org/repos/asf/gora/repo
Commit: http://git-wip-us.apache.org/repos/asf/gora/commit/3977e99b
Tree: http://git-wip-us.apache.org/repos/asf/gora/tree/3977e99b
Diff: http://git-wip-us.apache.org/repos/asf/gora/diff/3977e99b

Branch: refs/heads/master
Commit: 3977e99b1ada20355acab444d4c60ec2186dac63
Parents: 4f98503
Author: Lewis John McGibbney <lewis.j.mcgibbney@jpl.nasa.gov>
Authored: Sun Feb 28 12:55:29 2016 -0800
Committer: Lewis John McGibbney <lewis.j.mcgibbney@jpl.nasa.gov>
Committed: Sun Feb 28 12:55:29 2016 -0800

----------------------------------------------------------------------
 .../org/apache/gora/cassandra/query/CassandraSubColumn.java  | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/gora/blob/3977e99b/gora-cassandra/src/main/java/org/apache/gora/cassandra/query/CassandraSubColumn.java
----------------------------------------------------------------------
diff --git a/gora-cassandra/src/main/java/org/apache/gora/cassandra/query/CassandraSubColumn.java
b/gora-cassandra/src/main/java/org/apache/gora/cassandra/query/CassandraSubColumn.java
index 72cd0dd..03e94e5 100644
--- a/gora-cassandra/src/main/java/org/apache/gora/cassandra/query/CassandraSubColumn.java
+++ b/gora-cassandra/src/main/java/org/apache/gora/cassandra/query/CassandraSubColumn.java
@@ -47,8 +47,12 @@ public class CassandraSubColumn extends CassandraColumn {
     Object value = null;
     if (type.equals(Type.ARRAY)) {
       ListSerializer<?> serializer = ListSerializer.get(fieldSchema.getElementType());
-      List<?> genericArray = serializer.fromByteBuffer(byteBuffer);
-      value = genericArray;
+      if (serializer != null) {
+        List<?> genericArray = serializer.fromByteBuffer(byteBuffer);
+        value = genericArray;
+      } else {
+        LOG.warn("Field detected as type Array, however no serializer could be found!")
+      }
     } else if (type.equals(Type.MAP)) {
 //      MapSerializer<?> serializer = MapSerializer.get(fieldSchema.getValueType());
 //      Map<?, ?> map = serializer.fromByteBuffer(byteBuffer);


Mime
View raw message