From 4b6ff1fec23b4a67b8bef502922ee9801c84a394 Mon Sep 17 00:00:00 2001 From: Antti Villberg Date: Mon, 3 Apr 2017 10:24:40 +0300 Subject: [PATCH] Guard against NPE in ConnectionRelationLabelDecorationRule refs #7121 Change-Id: I3067fa3f80823690301239adba24f3548721a500 --- .../label/ConnectionRelationLabelDecorationRule.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } }; -- 2.47.1