From: Antti Villberg Date: Mon, 3 Apr 2017 07:24:40 +0000 (+0300) Subject: Guard against NPE in ConnectionRelationLabelDecorationRule X-Git-Tag: v1.29.0~120 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F93%2F393%2F3;p=simantics%2Fplatform.git Guard against NPE in ConnectionRelationLabelDecorationRule refs #7121 Change-Id: I3067fa3f80823690301239adba24f3548721a500 --- diff --git a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/modelBrowser2/label/ConnectionRelationLabelDecorationRule.java b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/modelBrowser2/label/ConnectionRelationLabelDecorationRule.java index dc0ee266b..952d9c8c4 100644 --- a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/modelBrowser2/label/ConnectionRelationLabelDecorationRule.java +++ b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/modelBrowser2/label/ConnectionRelationLabelDecorationRule.java @@ -31,7 +31,7 @@ public class ConnectionRelationLabelDecorationRule implements LabelDecorationRul static LabelDecorator DECO = new LabelDecorator.Stub() { @SuppressWarnings("unchecked") public 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; } };