Issue #1515 - Add null check to nsCSSFrameConstructor::IsValidSibling

With the changes to layout for WebComponents, it is now apparently possible to
pass in null for frame tree items to this function, which would cause a null
deref crash if not checked.
This commit is contained in:
Moonchild
2021-02-03 11:10:44 +00:00
committed by roytam1
parent ad0f41898a
commit 5fb8c296a0
+5
View File
@@ -6464,6 +6464,11 @@ nsCSSFrameConstructor::IsValidSibling(nsIFrame* aSibling,
nsIContent* aContent,
StyleDisplay& aDisplay)
{
if (!aSibling || !aContent) {
// If either of these are null, no sane comparison can be made.
return false;
}
nsIFrame* parentFrame = aSibling->GetParent();
nsIAtom* parentType = parentFrame->GetType();