From b0cf01a9569cd2d99073139205d8bc0152631e29 Mon Sep 17 00:00:00 2001 From: PseudoKnight Date: Wed, 11 Dec 2024 00:08:36 -0800 Subject: [PATCH] Fix NPE in LangServ on bad aliases --- src/main/java/com/laytonsmith/core/Script.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/com/laytonsmith/core/Script.java b/src/main/java/com/laytonsmith/core/Script.java index 69b4e17bd..201290d28 100644 --- a/src/main/java/com/laytonsmith/core/Script.java +++ b/src/main/java/com/laytonsmith/core/Script.java @@ -77,7 +77,7 @@ public class Script { private List left; private List fullRight; private List cleft; - private List cright; + private final List cright = new ArrayList<>(); private boolean nolog = false; //This should be null if we are running in non-alias mode private Map leftVars; @@ -192,7 +192,6 @@ public static Script GenerateScript(ParseTree tree, String label, SmartComment c s.hasBeenCompiled = true; s.compilerError = false; - s.cright = new ArrayList<>(); s.cright.add(tree); s.label = label; s.smartComment = comment; @@ -929,7 +928,6 @@ public void compileRight(Environment env) throws ConfigCompileException, ConfigC } } right.add(temp); - cright = new ArrayList<>(); for(List l : right) { StaticAnalysis analysis = new StaticAnalysis(true); cright.add(MethodScriptCompiler.compile(new TokenStream(l, fileOptions), env, envs, analysis));