From 479e884a06affa30032aec7e0d79c4a2c0023fb6 Mon Sep 17 00:00:00 2001 From: Konloch Date: Wed, 21 Jul 2021 06:28:07 -0700 Subject: [PATCH] Fallback For No JS Engine --- .../plugin/strategies/JavascriptPluginLaunchStrategy.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/strategies/JavascriptPluginLaunchStrategy.java b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/strategies/JavascriptPluginLaunchStrategy.java index bd3db8f2..373f5930 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/strategies/JavascriptPluginLaunchStrategy.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/strategies/JavascriptPluginLaunchStrategy.java @@ -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);