diff --git a/dom/base/nsINode.cpp b/dom/base/nsINode.cpp index 235122954f820..3a9fe23899dee 100644 --- a/dom/base/nsINode.cpp +++ b/dom/base/nsINode.cpp @@ -359,7 +359,9 @@ bool nsINode::IsSelected(const uint32_t aStartOffset, // Looks like that IsInSelection() assert fails sometimes... if (range->IsInAnySelection()) { for (const WeakPtr& selection : range->GetSelections()) { - ancestorSelections.Insert(selection); + if (selection) { + ancestorSelections.Insert(selection); + } } } }