]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Guard against NPE in ConnectionRelationLabelDecorationRule 93/393/3
authorAntti Villberg <antti.villberg@semantum.fi>
Mon, 3 Apr 2017 07:24:40 +0000 (10:24 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Mon, 3 Apr 2017 16:50:33 +0000 (19:50 +0300)
refs #7121

Change-Id: I3067fa3f80823690301239adba24f3548721a500

bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/modelBrowser2/label/ConnectionRelationLabelDecorationRule.java

index dc0ee266bf92d3235e09a9471d426e37fc595ac0..952d9c8c4a057a62c6b431567b877b95e93ec6c8 100644 (file)
@@ -31,7 +31,7 @@ public class ConnectionRelationLabelDecorationRule implements LabelDecorationRul
     static LabelDecorator DECO = new LabelDecorator.Stub() {
         @SuppressWarnings("unchecked")
         public <F> F decorateFont(F font, String column, int itemIndex) {
-            return (F) ((FontDescriptor) font).withStyle(SWT.BOLD); 
+            return font != null ? (F) ((FontDescriptor) font).withStyle(SWT.BOLD) : null;
         }
     };