]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Fixed NPE from ConnectionPointNameStyle.applyStyleForNode 82/2682/1
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Thu, 20 Sep 2018 12:45:46 +0000 (15:45 +0300)
committerMarko Luukkainen <marko.luukkainen@semantum.fi>
Mon, 25 Feb 2019 09:06:13 +0000 (09:06 +0000)
gitlab #129

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

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);