diff --git a/accessible/base/SelectionManager.cpp b/accessible/base/SelectionManager.cpp index dfbcc85e4b62..dd7e3b32f269 100644 --- a/accessible/base/SelectionManager.cpp +++ b/accessible/base/SelectionManager.cpp @@ -219,6 +219,11 @@ bool SelectionManager::SelectionRangeChanged(SelectionType aType, dom::Document* doc = start->OwnerDoc(); MOZ_ASSERT(doc); nsINode* node = aRange.GetClosestCommonInclusiveAncestor(); + if (!node) { + // Bug 1954751: This can happen when a Selection is being garbage collected, + // but it's unclear exactly what other circumstances are involved. + return false; + } HyperTextAccessible* acc = nsAccUtils::GetTextContainer(node); if (!acc) { return true;