You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by sf...@apache.org on 2014/10/10 17:50:33 UTC

[26/43] git commit: fix null reference exception

fix null reference exception


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

Branch: refs/heads/two-dot-o-events
Commit: 8b0355fee160290d77a20477b5e54acafb3d0bf2
Parents: 3fdc74f
Author: Shawn Feldman <sf...@apache.org>
Authored: Thu Oct 9 15:40:40 2014 -0600
Committer: Shawn Feldman <sf...@apache.org>
Committed: Thu Oct 9 15:40:40 2014 -0600

----------------------------------------------------------------------
 .../persistence/collection/mvcc/stage/load/GetVersion.java         | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/8b0355fe/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/load/GetVersion.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/load/GetVersion.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/load/GetVersion.java
index 2069818..a267cc9 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/load/GetVersion.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/load/GetVersion.java
@@ -61,7 +61,7 @@ public class GetVersion implements Func1<CollectionIoEvent<Id>, UUID> {
         final UUID latestVersion;
         try {
             List<MvccLogEntry> logEntries = logStrat.load( cs, id, UUIDGenerator.newTimeUUID(), 1 );
-            latestVersion = logEntries.get(0).getVersion();
+            latestVersion = logEntries.size()>0 ? logEntries.get(0).getVersion():null;
 
         } catch (ConnectionException ex) {
             throw new RuntimeException("Unable to get latest version of entity " +