Skip to content

Commit 0606442

Browse files
committed
Fix core error when reflect_docs() is given one argument
1 parent 5a470cd commit 0606442

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/main/java/com/laytonsmith/core/functions/Reflection.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,9 @@ public ParseTree optimizeDynamic(Target t, List<ParseTree> children, FileOptions
295295
//and then it will never actually get called, so we handle it entirely in here.
296296
return new ParseTree(new CString(docs(), t), null);
297297
}
298+
if(children.size() == 1) {
299+
return null; // not enough arguments, so an exception will be thrown later
300+
}
298301
if(children.get(0).isConst()) {
299302
//If it's a function, we can check to see if it actually exists,
300303
//and make it a compile error if it doesn't, even if parameter 2 is dynamic

0 commit comments

Comments
 (0)