Bug 352520. Backspace when deleting last char from URL bar crashes. Wallpaper fix for now. Patch by smontagu. r=aaronlev, sr=neil.

This commit is contained in:
aaronleventhal%moonset.net 2006-09-28 22:02:20 +00:00
parent 0a66a04657
commit 7ba88106fc

View File

@ -4620,6 +4620,10 @@ nsEditor::DeleteSelectionImpl(nsIEditor::EDirection aAction)
selection->GetFocusOffset(&deleteCharOffset);
if (!deleteCharData) {
nsCOMPtr<nsINode> parentNode(do_QueryInterface(deleteNode));
PRUint32 childCount = parentNode->GetChildCount();
// XXX Need to get correct info for backspace at end of text
if (deleteCharOffset >= childCount)
deleteCharOffset = childCount - 1;
deleteNode = do_QueryInterface(parentNode->GetChildAt(deleteCharOffset));
deleteCharData = do_QueryInterface(deleteNode);
deleteCharOffset = 0;