mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
[XForms] Fix crash in insert/delete. Bug 310840, r=me+aaronr
This commit is contained in:
parent
ab51a62cf5
commit
1ab71f8e96
@ -182,6 +182,10 @@ nsXFormsInsertDeleteElement::HandleAction(nsIDOMEvent *aEvent,
|
||||
nodeset->SnapshotItem(atInt - 1, getter_AddRefs(location));
|
||||
NS_ENSURE_STATE(location);
|
||||
|
||||
nsCOMPtr<nsIDOMNode> parent;
|
||||
location->GetParentNode(getter_AddRefs(parent));
|
||||
NS_ENSURE_STATE(parent);
|
||||
|
||||
if (mIsInsert && insertAfter) {
|
||||
nsCOMPtr<nsIDOMNode> temp;
|
||||
// If we're at the end of the nodeset, this returns nsnull, which is fine,
|
||||
@ -189,11 +193,6 @@ nsXFormsInsertDeleteElement::HandleAction(nsIDOMEvent *aEvent,
|
||||
location->GetNextSibling(getter_AddRefs(temp));
|
||||
location.swap(temp);
|
||||
}
|
||||
|
||||
|
||||
nsCOMPtr<nsIDOMNode> parent;
|
||||
location->GetParentNode(getter_AddRefs(parent));
|
||||
NS_ENSURE_STATE(parent);
|
||||
|
||||
nsCOMPtr<nsIDOMNode> resNode;
|
||||
if (mIsInsert) {
|
||||
|
Loading…
Reference in New Issue
Block a user