fix crash in nsMenuX::OnCreate(). b=443455 r=smichaud sr=roc a=ss
git-svn-id: svn://10.0.0.236/trunk@253333 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
5d4b7a3514
commit
042e8aac0c
@ -741,8 +741,16 @@ PRBool nsMenuX::OnCreate()
|
|||||||
// now need to walk our menu items, checking to see if any of them have
|
// now need to walk our menu items, checking to see if any of them have
|
||||||
// a command attribute. If so, several apptributes must potentially
|
// a command attribute. If so, several apptributes must potentially
|
||||||
// be updated.
|
// be updated.
|
||||||
if (popupContent) {
|
|
||||||
|
// Get new popup content first since it might have changed as a result of the
|
||||||
|
// NS_XUL_POPUP_SHOWING event above.
|
||||||
|
GetMenuPopupContent(getter_AddRefs(popupContent));
|
||||||
|
if (!popupContent)
|
||||||
|
return PR_TRUE;
|
||||||
|
|
||||||
nsCOMPtr<nsIDOMDocument> domDoc(do_QueryInterface(popupContent->GetDocument()));
|
nsCOMPtr<nsIDOMDocument> domDoc(do_QueryInterface(popupContent->GetDocument()));
|
||||||
|
if (!domDoc)
|
||||||
|
return PR_TRUE;
|
||||||
|
|
||||||
PRUint32 count = popupContent->GetChildCount();
|
PRUint32 count = popupContent->GetChildCount();
|
||||||
for (PRUint32 i = 0; i < count; i++) {
|
for (PRUint32 i = 0; i < count; i++) {
|
||||||
@ -791,7 +799,6 @@ PRBool nsMenuX::OnCreate()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return PR_TRUE;
|
return PR_TRUE;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user