summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2020-04-13 12:55:47 +0200
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-04-13 12:55:47 +0200
commitd7ec0143e3adf531547581ca64f8be9afba560bf (patch)
tree9a899d2096fc6578cb9904d4217218dd4689f0f9 /editor
parentb41a9a006c001e896ac3e49fb1c04283b8ede1b7 (diff)
downloadaura-central-d7ec0143e3adf531547581ca64f8be9afba560bf.tar.gz
Issue mcp-graveyard/UXP%1513 - Bail on orphan node
This was refactored by Mozilla into doing effectively the same thing so it aligns with them re: behavior. Resolves %1513
Diffstat (limited to 'editor')
-rw-r--r--editor/libeditor/HTMLEditRules.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/editor/libeditor/HTMLEditRules.cpp b/editor/libeditor/HTMLEditRules.cpp
index c2d61f767..545e22f70 100644
--- a/editor/libeditor/HTMLEditRules.cpp
+++ b/editor/libeditor/HTMLEditRules.cpp
@@ -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!