Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException fix when calling JS methods exposed as JavaProxys - JSR223 #1456

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

EduFrazao
Copy link

With a JavaScript like that

    function run() {
         print('Some string');
    }

If I try to invoke it from a JavaProxy using this code, I got a NullPointerException

   final ScriptEngine engine = engineManager.getEngineByName("rhino");
   engine.eval(myScript);
   Invocable inv = (Invocable) engine;
   Runnable runnable = inv.getInterface(Runnable.class);
   runnable.run();

 and exposed as a JavaProxy calling "getInterface"
 of RhinoScriptEngine
@rbri
Copy link
Collaborator

rbri commented Apr 27, 2024

@EduFrazao can you please add an unit test to your PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants