Bail on orphan node.

This commit is contained in:
Fedor 2020-05-07 14:45:31 +03:00
parent 33c856dd71
commit 66e78cb6b8

View File

@ -4641,7 +4641,11 @@ HTMLEditRules::WillAlign(Selection& aSelection,
} }
nsCOMPtr<nsINode> curParent = curNode->GetParentNode(); 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 // Skip insignificant formatting text nodes to prevent unnecessary
// structure splitting! // structure splitting!