Skip to content

Commit 66ab3f2

Browse files
committed
fix: simplify boolean evaluation logic in ExpressionParser
1 parent 45911a7 commit 66ab3f2

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

src/main/java/mindustrytool/workflow/expressions/ExpressionParser.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -157,18 +157,10 @@ public Boolean evaluateAsBoolean(String expr, Map<String, Object> variables) {
157157
return (Boolean) result;
158158
}
159159

160-
if (result == null) {
161-
return false;
162-
}
163-
164160
if (result instanceof String) {
165161
return Boolean.parseBoolean(result.toString());
166162
}
167-
168-
if (result instanceof Number) {
169-
return ((Number) result).doubleValue() != 0;
170-
}
171-
163+
172164
throw new WorkflowError("Invalid boolean value: " + result.toString());
173165
}
174166

0 commit comments

Comments
 (0)