diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/script/expression/operator/math/DivideOperator.java b/BauSystem_Main/src/de/steamwar/bausystem/features/script/expression/operator/math/DivideOperator.java index 679c69de..a4ab1c8c 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/script/expression/operator/math/DivideOperator.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/script/expression/operator/math/DivideOperator.java @@ -41,6 +41,9 @@ public class DivideOperator implements Operator { if (is(value, Value.StringValue.class, Value.BooleanValue.class) || is(value2, Value.StringValue.class, Value.BooleanValue.class)) { throw new IllegalArgumentException("SCRIPT_COMMAND_ARITHMETIC_DIV_ERROR"); } + if (value2.asDouble() == 0) { + return new Value.DoubleValue(Double.NaN); + } return new Value.DoubleValue(value.asDouble() / value2.asDouble()); } }