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

NPE in MemberBox.java #1477

Closed
p3k opened this issue May 18, 2024 · 4 comments
Closed

NPE in MemberBox.java #1477

p3k opened this issue May 18, 2024 · 4 comments
Labels
bug Issues considered a bug Regression

Comments

@p3k
Copy link

p3k commented May 18, 2024

I am seeing a null pointer in MemberBox.java related to the changes in 73a8b29:

// Wrapped java.lang.NullPointerException: Cannot read the array length because "args" is null
for (int i = 0; i < args.length; ++i) {
    if (args[i] instanceof Delegator) {
        args[i] = ((Delegator) args[i]).getDelegee();
    }
}

Tracing back the issue I see Context.emptyArgs is indeed null when calling MemberBox.invoke() in JavaMembers.java:

// Context.emptyArgs is null
rval = bp.getter.invoke(javaObject, Context.emptyArgs);

The weird thing is, though, that Context.emptyArgs actually should be the same as ScriptRuntime.emptyArgs (which is not null) – but it obviously isn’t:

// This resolves the issue
rval = bp.getter.invoke(javaObject, ScriptRuntime.emptyArgs);

It could be there is some code in my project causing this, see antville/helma#75 (comment).

Unfortunately, I am not very experienced with Java, just inherited the Java/Rhino part of the project. Thus, I would be very thankful for any suggestions.

@kleiteimc
Copy link

Came across the same error using Helma 1.7.2

@p-bakker
Copy link
Collaborator

@rbri any thoughts on this one, as it's (supposedly) related to the changes made by you in 73a8b29?

@rbri
Copy link
Collaborator

rbri commented Jun 22, 2024

will have a look and provide a fix

@p-bakker p-bakker added the bug Issues considered a bug label Jun 24, 2024
@p-bakker
Copy link
Collaborator

p-bakker commented Aug 8, 2024

Resolved by #1538

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

No branches or pull requests

4 participants