Unwrap native java objects gotten as properties.

This commit is contained in:
hns 2003-06-10 15:41:57 +00:00
parent 534bba3d69
commit 67f38dceb8

View file

@ -394,15 +394,17 @@ public final class RhinoEngine implements ScriptingEngine {
try { try {
Object prop = so.get(propname, so); Object prop = so.get(propname, so);
if (prop != Undefined.instance) { if ((prop == null) || (prop == Undefined.instance)) {
return null;
} else if (prop instanceof NativeJavaObject) {
return ((NativeJavaObject) prop).unwrap();
} else {
return prop; return prop;
} }
} catch (Exception esx) { } catch (Exception esx) {
// System.err.println ("Error in getProperty: "+esx); // System.err.println ("Error in getProperty: "+esx);
return null; return null;
} }
return null;
} }
/** /**