diff --git a/content/xul/document/src/XULDocument.cpp b/content/xul/document/src/XULDocument.cpp index faf10bd4c64..779457d007f 100644 --- a/content/xul/document/src/XULDocument.cpp +++ b/content/xul/document/src/XULDocument.cpp @@ -3871,8 +3871,10 @@ XULDocument::CreateTemplateBuilder(nsIContent* aElement) if (! builder) return NS_ERROR_FAILURE; - builder->Init(aElement); - builder->CreateContents(aElement, false); + nsresult rv = builder->Init(aElement); + NS_ENSURE_SUCCESS(rv, rv); + rv = builder->CreateContents(aElement, false); + NS_ENSURE_SUCCESS(rv, rv); } return NS_OK; diff --git a/content/xul/templates/src/nsXULTemplateBuilder.cpp b/content/xul/templates/src/nsXULTemplateBuilder.cpp index 6946514d2ab..ba8be17060c 100644 --- a/content/xul/templates/src/nsXULTemplateBuilder.cpp +++ b/content/xul/templates/src/nsXULTemplateBuilder.cpp @@ -1243,7 +1243,8 @@ nsXULTemplateBuilder::LoadDataSources(nsIDocument* aDocument, if (!mRoot->IsXUL()) { // Hmm. This must be an HTML element. Try to set it as a // JS property "by hand". - InitHTMLTemplateRoot(); + rv = InitHTMLTemplateRoot(); + NS_ENSURE_SUCCESS(rv, rv); } return NS_OK;