mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-02 09:18:36 +02:00
Bug 1954751: SelectionManager::SelectionRangeChanged: Fail gracefully if the range's closest common ancestor is null. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D242113
This commit is contained in:
parent
b999769951
commit
213a09599f
1 changed files with 5 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue