]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
isImmutable can NPE 58/758/2
authorAntti Villberg <antti.villberg@semantum.fi>
Mon, 24 Jul 2017 12:54:19 +0000 (15:54 +0300)
committerJani Simomaa <jani.simomaa@semantum.fi>
Tue, 25 Jul 2017 03:55:26 +0000 (06:55 +0300)
refs #7380

Change-Id: I8b1eac67b58664f0986dfeea5315f791721d8393

bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/ClusterTable.java

index 355764d178138df429450ab7eac5ab565dac8d00..40b2530f2a569a4dedfdb7295095895871074f1d 100644 (file)
@@ -1139,11 +1139,14 @@ public final class ClusterTable implements IClusterTable {
         if(exist != null) return exist;
 
         ClusterI cluster = getClusterByResourceKey(id);
-        boolean result = cluster == null ? false : cluster.getImmutable();
-
-        markImmutable(cluster, result);
-        return result;
-
+        if(cluster == null) {
+               return false;
+        } else {
+               boolean result = cluster.getImmutable();
+               markImmutable(cluster, result);
+               return result;
+        }
+        
     }
 
     public void markImmutable(ClusterI cluster, boolean value) {