Fallback For No JS Engine

This commit is contained in:
Konloch 2021-07-21 06:28:07 -07:00
parent 3fc02c46fa
commit 479e884a06
1 changed files with 4 additions and 0 deletions

View File

@ -51,6 +51,10 @@ public class JavascriptPluginLaunchStrategy implements PluginLaunchStrategy
if (engine == null)
{
engine = manager.getEngineByName(fallBackEngine);
if (engine == null)
throw new Exception("Cannot find Javascript script engine! Please contact Konloch.");
Bindings bindings = engine.getBindings(ScriptContext.ENGINE_SCOPE);
bindings.put("polyglot.js.allowHostAccess", true);
bindings.put("polyglot.js.allowAllAccess", true);