b13b51fb by Adam Heath

The javascript code will return null when there are no errors, but I'd

prefer to have an empty map returned in java land; so check for that and
do the right thing.
1 parent b3c08c71
......@@ -68,7 +68,11 @@ public class Require {
NativeObject r = container.call(modelInstance, "toJSON", container.javaToJS(extraOptions));
System.err.printf("r[%s]=%s\n", moduleId, container.toMap(r));
NativeObject errors = RhinoContainer.allowUndefined(container.call(modelInstance, "validate"));
return new HashMap<String, Object>(errors);
if (errors == null) {
return new HashMap<String, Object>();
} else {
return new HashMap<String, Object>(errors);
}
}
public static class Loader extends InContext<Function> {
......