Bail on orphan node.

This commit is contained in:
Fedor 2020-05-07 14:45:31 +03:00
parent 33c856dd71
commit 66e78cb6b8
1 changed files with 5 additions and 1 deletions

View File

@ -4641,7 +4641,11 @@ HTMLEditRules::WillAlign(Selection& aSelection,
}
nsCOMPtr<nsINode> curParent = curNode->GetParentNode();
int32_t offset = curParent ? curParent->IndexOf(curNode) : -1;
if (!curParent) {
continue;
}
int32_t offset = curParent->IndexOf(curNode);
// Skip insignificant formatting text nodes to prevent unnecessary
// structure splitting!