Skip to content

Commit b0cf01a

Browse files
committed
Fix NPE in LangServ on bad aliases
1 parent 7b59107 commit b0cf01a

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/main/java/com/laytonsmith/core/Script.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public class Script {
7777
private List<Token> left;
7878
private List<Token> fullRight;
7979
private List<Construct> cleft;
80-
private List<ParseTree> cright;
80+
private final List<ParseTree> cright = new ArrayList<>();
8181
private boolean nolog = false;
8282
//This should be null if we are running in non-alias mode
8383
private Map<String, Variable> leftVars;
@@ -192,7 +192,6 @@ public static Script GenerateScript(ParseTree tree, String label, SmartComment c
192192

193193
s.hasBeenCompiled = true;
194194
s.compilerError = false;
195-
s.cright = new ArrayList<>();
196195
s.cright.add(tree);
197196
s.label = label;
198197
s.smartComment = comment;
@@ -929,7 +928,6 @@ public void compileRight(Environment env) throws ConfigCompileException, ConfigC
929928
}
930929
}
931930
right.add(temp);
932-
cright = new ArrayList<>();
933931
for(List<Token> l : right) {
934932
StaticAnalysis analysis = new StaticAnalysis(true);
935933
cright.add(MethodScriptCompiler.compile(new TokenStream(l, fileOptions), env, envs, analysis));

0 commit comments

Comments
 (0)