diff --git a/dom/xml/nsXMLPrettyPrinter.cpp b/dom/xml/nsXMLPrettyPrinter.cpp index 7f1f2b07a8..3573523186 100644 --- a/dom/xml/nsXMLPrettyPrinter.cpp +++ b/dom/xml/nsXMLPrettyPrinter.cpp @@ -256,6 +256,8 @@ nsXMLPrettyPrinter::ContentRemoved(nsIDocument* aDocument, void nsXMLPrettyPrinter::NodeWillBeDestroyed(const nsINode* aNode) { + MOZ_DIAGNOSTIC_ASSERT(mDocument == aNode); + mDocument->RemoveMutationObserver(this); mDocument = nullptr; NS_RELEASE_THIS(); }