From d5353b8bc31d31bf437f489fe647f1eba5ed63d8 Mon Sep 17 00:00:00 2001 From: Brent <90901032@westernsydney.edu.au> Date: Mon, 19 Jun 2023 08:07:14 +1000 Subject: [PATCH] Prevent NPE in Beanshell execution during module initialisation --- .../src/main/java/VASSAL/script/ExpressionInterpreter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vassal-app/src/main/java/VASSAL/script/ExpressionInterpreter.java b/vassal-app/src/main/java/VASSAL/script/ExpressionInterpreter.java index baea66ef07..01afee1bbf 100644 --- a/vassal-app/src/main/java/VASSAL/script/ExpressionInterpreter.java +++ b/vassal-app/src/main/java/VASSAL/script/ExpressionInterpreter.java @@ -275,7 +275,7 @@ public String evaluate(PropertySource ps, java.util.Map properti // Check for a propoerty in the passed property Map, then check the source if not found Object prop = properties == null ? null : properties.get(name); if (prop == null) { - prop = localized ? source.getLocalizedProperty(name) : source.getProperty(name); + prop = (source == null) ? "" : localized ? source.getLocalizedProperty(name) : source.getProperty(name); } final String value = prop == null ? "" : prop.toString(); if (audit != null) {