Closed Bug 424926 Opened 18 years ago Closed 17 years ago

FunctionObject.convertArg() in case of JAVA_SCRIPTABLE_TYPE and arg==null fails

Categories

(Rhino Graveyard :: Core, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 461138

People

(Reporter: yuriy, Unassigned)

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12 Build Identifier: 1.7R1 the test case is a java object implementing a method with Scriptable argument the method is added as a functionProperty calling that method from javascript with null argument will cause an exception checking other argument types shows that they all handle null by returning null the proposed fix is @ line 240 - replacing toObject with toObjectOrNull this requires small refactoring of ScriptRuntime to create toObjectOrNull with the same signature Reproducible: Always Steps to Reproduce: 1. 2. 3.
Summary: FunctionObject.convertArg in case of JAVA_SCRIPTABLE_TYPE and arg==null fails → FunctionObject.convertArg() in case of JAVA_SCRIPTABLE_TYPE and arg==null fails
OS: Windows XP → All
Hardware: PC → All
Masking as duplicate of bug 461138 as that has a patch and testcase attached. Your proposed fix of introducing ScriptRuntime.toObjectOrNull() also sounds like a viable solution if it could be used in other places.
Status: UNCONFIRMED → RESOLVED
Closed: 17 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.