Bug 1127835 - part 1, Add a null-check to avoid fatal assertion if the split results in no left part. r=smaug

This commit is contained in:
Mats Palmgren 2015-02-02 22:34:17 +00:00
parent 962798c52c
commit 5818444d89

View File

@ -710,8 +710,10 @@ nsHTMLEditor::DoInsertHTMLWithContext(const nsAString & aInputString,
int32_t linkOffset;
rv = SplitNodeDeep(link, selNode, selOffset, &linkOffset, true, address_of(leftLink));
NS_ENSURE_SUCCESS(rv, rv);
selNode = GetNodeLocation(leftLink, &selOffset);
selection->Collapse(selNode, selOffset+1);
if (leftLink) {
selNode = GetNodeLocation(leftLink, &selOffset);
selection->Collapse(selNode, selOffset+1);
}
}
}
}