Skip to content

Commit cdab860

Browse files
committed
Add check against NullPointerException
1 parent 40d7c38 commit cdab860

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/org/mozilla/javascript/ScriptableObject.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1259,7 +1259,7 @@ static <T extends Scriptable> BaseFunction buildClassCtor(
12591259
Object existing = getProperty(getTopLevelScope(scope), className);
12601260
if (existing instanceof BaseFunction) {
12611261
Object existingProto = ((BaseFunction)existing).getPrototypeProperty();
1262-
if (clazz.equals(existingProto.getClass())) {
1262+
if (existingProto != null && clazz.equals(existingProto.getClass())) {
12631263
return (BaseFunction)existing;
12641264
}
12651265
}

0 commit comments

Comments
 (0)