fix(muscript): null-check in ExprUtils

This commit is contained in:
Johannes Frohnmeyer 2024-04-05 17:56:34 +02:00
parent 31282ed398
commit 3ec097ce28
Signed by: Johannes
GPG Key ID: E76429612C2929F4
1 changed files with 3 additions and 2 deletions

View File

@ -61,13 +61,14 @@ public class ExprUtils {
}
public static Expr unpack(Expr expression) {
return switch (expression) {
return unpack(switch (expression) {
case null -> throw new NullPointerException();
case BoolUnpack(var inner) -> inner;
case NumberUnpack(var inner) -> inner;
case StringUnpack(var inner) -> inner;
case DynamicCoerce(var inner) -> inner;
case StringCoerce(var inner) -> inner;
default -> expression;
};
});
}
}