From 9c178e9772bd4889838ebd9a0c6667536f0241aa Mon Sep 17 00:00:00 2001
From: Pieter12345
Date: Sat, 31 Aug 2024 03:56:49 +0200
Subject: [PATCH] Fix cmdline interpreter exception on empty input
---
src/main/java/com/laytonsmith/tools/Interpreter.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/main/java/com/laytonsmith/tools/Interpreter.java b/src/main/java/com/laytonsmith/tools/Interpreter.java
index c6fd0a528..526ceba67 100644
--- a/src/main/java/com/laytonsmith/tools/Interpreter.java
+++ b/src/main/java/com/laytonsmith/tools/Interpreter.java
@@ -836,7 +836,8 @@ public void execute(String script, List args, File fromFile) throws Conf
@Override
public void run() {
try {
- if(tree.getChildren().size() == 1 && tree.getChildAt(0).getData() instanceof IVariable ivar) {
+ if(tree != null && tree.getChildren().size() == 1
+ && tree.getChildAt(0).getData() instanceof IVariable ivar) {
Mixed i = env.getEnv(GlobalEnv.class).GetVarList()
.get(ivar.getVariableName(), ivar.getTarget(), env).ival();
StreamUtils.GetSystemOut().println(i.val());