diff --git a/docshell/base/nsWebShell.cpp b/docshell/base/nsWebShell.cpp index f278d4a38ec..c2b91b4a1f6 100644 --- a/docshell/base/nsWebShell.cpp +++ b/docshell/base/nsWebShell.cpp @@ -232,8 +232,10 @@ nsWebShell::FireUnloadForChildren() PRInt32 i, n = mChildren.Count(); for (i = 0; i < n; i++) { nsIDocShell* shell = (nsIDocShell*) mChildren.ElementAt(i); - nsCOMPtr webShell(do_QueryInterface(shell)); - rv = webShell->FireUnloadEvent(); + if(shell) { + nsCOMPtr webShell(do_QueryInterface(shell)); + rv = webShell->FireUnloadEvent(); + } } return rv;