Issue #2135 - Follow-up: Fix crash for passing nullptr as an argument to the aNodesWithProperties parameter

This commit is contained in:
FranklinDM 2023-03-04 23:41:31 +08:00 committed by roytam1
commit c194fbf6a8

View file

@ -259,12 +259,13 @@ SVGUseElement::CreateAnonymousContent()
}
}
nsCOMArray<nsINode> unused;
nsNodeInfoManager* nodeInfoManager =
targetContent->OwnerDoc() == OwnerDoc() ?
nullptr : OwnerDoc()->NodeInfoManager();
IgnoredErrorResult rv;
nsCOMPtr<nsINode> newnode =
nsNodeUtils::Clone(targetContent, true, nodeInfoManager, nullptr, rv);
nsNodeUtils::Clone(targetContent, true, nodeInfoManager, unused, rv);
nsCOMPtr<nsIContent> newcontent = do_QueryInterface(newnode);
if (!newcontent)