bug 130894, add null checks to avoid crashes found by js debugger users.

r=caillon@returnzero.com, sr=ben, a=asa
This commit is contained in:
rginda%netscape.com 2002-03-18 23:39:48 +00:00
parent c4fa3c40ac
commit f798d0c82d
2 changed files with 8 additions and 0 deletions

View File

@ -918,6 +918,12 @@ nsMenuFrame::OpenMenuInternal(PRBool aActivateFlag)
void
nsMenuFrame::GetMenuChildrenElement(nsIContent** aResult)
{
if (!mContent)
{
*aResult = nsnull;
return;
}
nsresult rv;
nsCOMPtr<nsIXBLService> xblService =
do_GetService("@mozilla.org/xbl;1", &rv);

View File

@ -391,6 +391,8 @@ nsXULTooltipListener::ShowTooltip()
// the tooltip. If there is an attribute on the popup telling us
// not to create the auto-hide timer, don't.
nsCOMPtr<nsIDOMElement> tooltipEl(do_QueryInterface(mCurrentTooltip));
if (!tooltipEl)
return NS_ERROR_FAILURE;
nsAutoString noAutoHide;
tooltipEl->GetAttribute(NS_LITERAL_STRING("noautohide"), noAutoHide);
if (noAutoHide != NS_LITERAL_STRING("true"))