Skip to content

Commit

Permalink
Fixes a NPE in JsConsoleManager.executeFile() that may make BC hang
Browse files Browse the repository at this point in the history
  • Loading branch information
KlasJoensson committed Nov 8, 2012
1 parent 9264836 commit bf92152
Showing 1 changed file with 10 additions and 3 deletions.
Expand Up @@ -120,10 +120,17 @@ protected IStatus run(final IProgressMonitor monitor) {
new ScriptAction(contents, new Hook() {
public void run( Object result ) {
monitor.done();
if ( !"org.mozilla.javascript.Undefined".equals(
result.getClass().getName() ) ) {
message(result.toString());
/* If the result is null and the user make an tab-
* completion, Bioclipse will hang.
* TODO Find a better solution */
if (result != null) {
if ( !"org.mozilla.javascript.Undefined"
.equals(result.getClass().getName() ) ) {
message(result.toString());
}
}
else
message("Script finished without any problems.");
}

private void message(final String text) {
Expand Down

0 comments on commit bf92152

Please sign in to comment.