]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Fixed NPE from ConnectionPointNameStyle.applyStyleForNode 13/2213/1
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Thu, 20 Sep 2018 12:45:46 +0000 (15:45 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Thu, 20 Sep 2018 13:00:13 +0000 (13:00 +0000)
gitlab #129

Change-Id: I7d5f3be3cc695e5a6e8f9cf131fcc24b275a5e85
(cherry picked from commit df479ad3f602a36c39374d95c0e205b27c868f94)

bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/diagram/style/ConnectionPointNameStyle.java

index a4f32e81139a5f22d699af3e7d15a5ee7ba3578b..d86925e485d187ef8d48e25535a091ffbcb5facd 100644 (file)
@@ -159,8 +159,8 @@ public class ConnectionPointNameStyle extends StyleBase<List<ConnectionPointName
         // always clean up old items before drawing new items
         cleanupStyleForNode(_node);
 
-        int count = resultList.size();
-        if (resultList == null || count < 2)
+        int count = resultList != null ? resultList.size() : 0;
+        if (count < 2)
             return;
 
         G2DParentNode parentNode = ProfileVariables.claimChild(_node, "", PARENT_NODE_NAME_PREFIX, G2DParentNode.class, observer);