Skip to content

Commit 57efb0d

Browse files
committed
Throw a better exception when factory not found
Previously, if a script engine is requested and not found, the findFactory method would return null, which would then get handed to the other constructor, which would then throw NullPointerException with no explanation of what the problem is.
1 parent 6e29c47 commit 57efb0d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/org/scijava/script/AdaptedScriptLanguage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ private static ScriptEngineFactory findFactory(final String factoryName) {
148148
if (factoryName.equals(name)) return factory;
149149
}
150150
}
151-
return null;
151+
throw new IllegalArgumentException("No such script engine: " + factoryName);
152152
}
153153

154154
}

0 commit comments

Comments
 (0)