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

Draft
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

@p-bakker p-bakker added the JSR 223 Script Engine Issues related to the JSR 223 Script Engine wrapper label Jul 21, 2024
@p-bakker p-bakker marked this pull request as draft September 8, 2024 07:18
@p-bakker
Copy link
Collaborator

p-bakker commented Sep 8, 2024

Converted to draft as it currently is missing a testcase

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JSR 223 Script Engine Issues related to the JSR 223 Script Engine wrapper
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants