Bug 1273152 - modify autogen python to prevent null pointer dereference on generates cpps. r?jst
MozReview-Commit-ID: 3dqJsJL7naw
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -12341,20 +12341,20 @@ class CGDictionary(CGThing):
""",
dictName=self.makeClassName(self.dictionary.parent))
else:
body += dedent(
"""
{ // scope for isConvertible
bool isConvertible;
- if (!IsConvertibleToDictionary(cx, val, &isConvertible)) {
+ if (cx && !IsConvertibleToDictionary(cx, val, &isConvertible)) {
return false;
}
- if (!isConvertible) {
+ if (cx && !isConvertible) {
return ThrowErrorMessage(cx, MSG_NOT_DICTIONARY, sourceDescription);
}
}
""")
memberInits = [self.getMemberConversion(m).define()
for m in self.memberInfo]