Bug 525725 -help crashes [@ LoadPlatformDirectory] r=bsmedberg
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Wed, 04 Nov 2009 21:34:16 +0000
changeset 34542 ac5673902abd48faad506ee5579f0f457c9e2df7
parent 34541 d59175a25fc6a632e2e1bfabd0a625f2a5dcda97
child 34543 c0d760c5165c9235322fe5d2788448c3710a0d51
push id10109
push userneil@parkwaycc.co.uk
push dateWed, 04 Nov 2009 21:36:28 +0000
treeherdermozilla-central@c0d760c5165c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs525725
milestone1.9.3a1pre
Bug 525725 -help crashes [@ LoadPlatformDirectory] r=bsmedberg
toolkit/xre/nsAppRunner.cpp
toolkit/xre/nsXREDirProvider.cpp
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -1217,17 +1217,19 @@ public:
 static void DumpArbitraryHelp()
 {
   nsresult rv;
 
   ScopedLogging log;
 
   {
     nsXREDirProvider dirProvider;
-    dirProvider.Initialize(nsnull, gAppData->xreDirectory);
+    rv = dirProvider.Initialize(gAppData->directory, gAppData->xreDirectory);
+    if (NS_FAILED(rv))
+      return;
 
     ScopedXPCOMStartup xpcom;
     xpcom.Initialize();
     xpcom.DoAutoreg();
 
     nsCOMPtr<nsICommandLineRunner> cmdline
       (do_CreateInstance("@mozilla.org/toolkit/command-line;1"));
     if (!cmdline)
--- a/toolkit/xre/nsXREDirProvider.cpp
+++ b/toolkit/xre/nsXREDirProvider.cpp
@@ -114,16 +114,17 @@ nsXREDirProvider::~nsXREDirProvider()
   gDirServiceProvider = nsnull;
 }
 
 nsresult
 nsXREDirProvider::Initialize(nsIFile *aXULAppDir,
                              nsILocalFile *aGREDir,
                              nsIDirectoryServiceProvider* aAppProvider)
 {
+  NS_ENSURE_ARG(aXULAppDir);
   NS_ENSURE_ARG(aGREDir);
 
   mAppProvider = aAppProvider;
   mXULAppDir = aXULAppDir;
   mGREDir = aGREDir;
 
   if (!mProfileDir) {
     nsCOMPtr<nsIDirectoryServiceProvider> app(do_QueryInterface(mAppProvider));