Skip to content

NPE in MemberBox.java #1477

@p3k

Description

@p3k

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions