From 52180e2e1e04d02b920c633930c3f5da469de41a Mon Sep 17 00:00:00 2001 From: Christian Menard Date: Fri, 22 Sep 2023 17:11:38 +0200 Subject: [PATCH] Avoid null pointer exception in diagrams with bodyless reactions --- .../diagram/synthesis/styles/LinguaFrancaShapeExtensions.java | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/main/java/org/lflang/diagram/synthesis/styles/LinguaFrancaShapeExtensions.java b/core/src/main/java/org/lflang/diagram/synthesis/styles/LinguaFrancaShapeExtensions.java index b8ee69fa1c..893d7df47b 100644 --- a/core/src/main/java/org/lflang/diagram/synthesis/styles/LinguaFrancaShapeExtensions.java +++ b/core/src/main/java/org/lflang/diagram/synthesis/styles/LinguaFrancaShapeExtensions.java @@ -444,6 +444,7 @@ public KPolygon addReactionFigure(KNode node, ReactionInstance reaction) { // optional code content boolean hasCode = getBooleanValue(LinguaFrancaSynthesis.SHOW_REACTION_CODE) + && reaction.getDefinition().getCode() != null && !StringExtensions.isNullOrEmpty(reaction.getDefinition().getCode().getBody()); if (hasCode) { KText hasCodeText =