summaryrefslogtreecommitdiff
path: root/editor/libeditor/HTMLEditRules.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/libeditor/HTMLEditRules.cpp')
-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 c2d61f767b..545e22f701 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!