Skip to content

Commit

Permalink
NPE fix when a non-argument JavaScript method is collected
Browse files Browse the repository at this point in the history
 and exposed as a JavaProxy calling "getInterface"
 of RhinoScriptEngine
  • Loading branch information
EduFrazao committed Mar 13, 2024
1 parent 7d2c242 commit d4c21bc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/org/mozilla/javascript/engine/RhinoScriptEngine.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.mozilla.javascript.ContextFactory;
import org.mozilla.javascript.RhinoException;
import org.mozilla.javascript.Script;
import org.mozilla.javascript.ScriptRuntime;
import org.mozilla.javascript.Scriptable;
import org.mozilla.javascript.ScriptableObject;

Expand Down Expand Up @@ -201,6 +202,8 @@ Object invokeMethodRaw(Object thiz, String name, Class<?> returnType, Object...
for (int i = 0; i < args.length; i++) {
args[i] = Context.javaToJS(args[i], scope);
}
} else {
args = ScriptRuntime.emptyArgs;
}

Object ret = func.call(cx, scope, localThis, args);
Expand Down

0 comments on commit d4c21bc

Please sign in to comment.