Bug 773665 - Don't crash during shutdown because XPCOM is already mostly-dead and refuses to create a local file, r=ted
authorBenjamin Smedberg <benjamin@smedbergs.us>
Fri, 13 Jul 2012 13:43:17 -0400
changeset 99165 1dbe063197396eac57de0cb732c13aa586252d51
parent 99164 9c2d509f2aabf33befe18f42d9f1d4e4f32186c6
child 99166 be26e809e6b1cd1cee82a687bf57f9f45d286f07
push id23107
push userbsmedberg@mozilla.com
push dateFri, 13 Jul 2012 17:58:55 +0000
treeherdermozilla-central@1dbe06319739 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs773665
milestone16.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 773665 - Don't crash during shutdown because XPCOM is already mostly-dead and refuses to create a local file, r=ted
toolkit/crashreporter/nsExceptionHandler.cpp
--- a/toolkit/crashreporter/nsExceptionHandler.cpp
+++ b/toolkit/crashreporter/nsExceptionHandler.cpp
@@ -1702,16 +1702,20 @@ static bool
 GetPendingDir(nsIFile** dir)
 {
   MOZ_ASSERT(OOPInitialized());
   if (!pendingDirectory) {
     return false;
   }
 
   nsCOMPtr<nsIFile> pending = do_CreateInstance(NS_LOCAL_FILE_CONTRACTID);
+  if (!pending) {
+    NS_WARNING("Can't set up pending directory during shutdown.");
+    return false;
+  }
 #ifdef XP_WIN
   pending->InitWithPath(nsDependentString(pendingDirectory));
 #else
   pending->InitWithNativePath(nsDependentCString(pendingDirectory));
 #endif
   pending.swap(*dir);
   return true;
 }