You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by sn...@apache.org on 2014/04/06 00:20:50 UTC

[2/3] git commit: fix for bug USERGRID-22, ICLA - Malaka Mahanama

fix for bug USERGRID-22, ICLA - Malaka Mahanama


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/dbfd345b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/dbfd345b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/dbfd345b

Branch: refs/pull/99/merge
Commit: dbfd345b9ba68040a6728e794d3742cfd90d3175
Parents: 778511b
Author: Malaka <ma...@gmail.com>
Authored: Sun Apr 6 02:52:29 2014 +0530
Committer: Malaka <ma...@gmail.com>
Committed: Sun Apr 6 02:52:29 2014 +0530

----------------------------------------------------------------------
 .../java/org/apache/usergrid/persistence/Query.java    | 13 +++++++++++++
 1 file changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/dbfd345b/stack/core/src/main/java/org/apache/usergrid/persistence/Query.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/persistence/Query.java b/stack/core/src/main/java/org/apache/usergrid/persistence/Query.java
index 6cc8249..23970f0 100644
--- a/stack/core/src/main/java/org/apache/usergrid/persistence/Query.java
+++ b/stack/core/src/main/java/org/apache/usergrid/persistence/Query.java
@@ -371,6 +371,11 @@ public class Query {
             return false;
         }
         for ( Identifier identifier : identifiers ) {
+        	
+        	//part of fix for the bug USERGRID-22 (to prevent a null pointer exception).
+        	if (identifier == null)
+        	{ return false; }
+        	
             if ( !identifier.isEmail() && !identifier.isName() ) {
                 return false;
             }
@@ -413,6 +418,10 @@ public class Query {
         }
 
         for ( Identifier identifier : identifiers ) {
+        	
+        	//part of fix for the bug USERGRID-22 (to prevent a null pointer exception).
+        	if (identifier == null){ return true; }
+        	
             if ( !identifier.isUUID() ) {
                 return false;
             }
@@ -442,6 +451,10 @@ public class Query {
         if ( !containsSingleUuidIdentifier() ) {
             return null;
         }
+        //part of fix for the bug USERGRID-22 (to prevent a null pointer exception).
+        if(identifiers.get( 0 )==null)
+        { return null; }
+        
         return ( identifiers.get( 0 ).getUUID() );
     }