Skip to content

Commit

Permalink
Merge pull request #982 from pi-r-p/fix#981
Browse files Browse the repository at this point in the history
fix a npe in WarpScript exception message
  • Loading branch information
hbs authored Jun 29, 2021
2 parents 56f44a1 + 1c26dcd commit 2bb0542
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,10 @@ public void exec(Macro macro) throws WarpScriptException {
String name = macro.getName();
String section = (String) this.getAttribute(WarpScriptStack.ATTRIBUTE_SECTION_NAME);
Object statement = macro.get(i);
String statementString = statement.toString();
if (i >= macro.size()) {
statement = macro.get(macro.size() - 1);
}
String statementString = String.valueOf(statement);
// For NamedWarpScriptFunction, toString is used for snapshotting. Getting the name is better to generate
// a clear error message.
if(statement instanceof NamedWarpScriptFunction) {
Expand Down

0 comments on commit 2bb0542

Please sign in to comment.