diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index 2cc5ec818d..b40e6f8b61 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -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();