Backed out changeset f1f0f69bc78f (
bug 1324505)
MozReview-Commit-ID: 1DbtAJzgJYo
--- a/editor/libeditor/HTMLEditRules.cpp
+++ b/editor/libeditor/HTMLEditRules.cpp
@@ -7859,20 +7859,17 @@ HTMLEditRules::PopListItem(nsIDOMNode* a
nsCOMPtr<Element> listItem = do_QueryInterface(aListItem);
// check parms
NS_ENSURE_TRUE(listItem && aOutOfList, NS_ERROR_NULL_POINTER);
// init out params
*aOutOfList = false;
nsCOMPtr<nsINode> curParent = listItem->GetParentNode();
- if (NS_WARN_IF(!curParent)) {
- return NS_ERROR_FAILURE;
- }
- int32_t offset = curParent->IndexOf(listItem);
+ int32_t offset = curParent ? curParent->IndexOf(listItem) : -1;
if (!HTMLEditUtils::IsListItem(listItem)) {
return NS_ERROR_FAILURE;
}
// if it's first or last list item, don't need to split the list
// otherwise we do.
nsCOMPtr<nsINode> curParPar = curParent->GetParentNode();