Skip to content

Commit

Permalink
Fixed NPE in Script.run.
Browse files Browse the repository at this point in the history
  • Loading branch information
LadyCailin committed Aug 28, 2013
1 parent 6d83fa9 commit d1eb5c7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/main/java/com/laytonsmith/core/Script.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,8 @@ public void run(final List<Variable> vars, Environment myEnv, final MethodScript
//Oh well, we tried to get more information
}
}
throw new ConfigRuntimeException("Unable to run command, script not yet compiled, or a compiler error occured for that command."
+ " To see the compile error, run /reloadaliases",
null, target);
throw ConfigRuntimeException.CreateUncatchableException("Unable to run command, script not yet compiled, or a compiler error occured for that command."
+ " To see the compile error, run /reloadaliases", target);
}
if (p instanceof MCPlayer) {
if (CurrentEnv.getEnv(GlobalEnv.class).GetLabel() != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,8 @@ public static void DoWarning(Exception e, String optionalMessage, boolean checkP
private Environment env;
private Target target;
/**
* Creates a new ConfigRuntimeException. If ex is not null, this exception can be caught
* by user level code. Otherwise, it will be ignored by the try() function.
* Creates a new ConfigRuntimeException. If the exception is intended to be uncatchable,
* use {@link #CreateUncatchableException} instead.
* @param msg The message to be displayed
* @param ex The type of exception this is, as seen by user level code
* @param line_num The line this exception is being thrown from
Expand All @@ -356,7 +356,7 @@ public ConfigRuntimeException(String msg, ExceptionType ex, Target t){
public ConfigRuntimeException(String msg, ExceptionType ex, Target t, Throwable cause){
super(msg, cause);
if(ex == null){
throw new NullPointerException();
throw new NullPointerException("Use CreateUncatchableException instead.");
}
createException(ex, t);
}
Expand Down

0 comments on commit d1eb5c7

Please sign in to comment.