Bug 1528568 - Add error handling for the call to nsIFile::Exists() in nsToolkitProfileService::SelectStartupProfile(); r=mossop
authorEhsan Akhgari <ehsan@mozilla.com>
Sat, 16 Feb 2019 22:21:41 +0000
changeset 459821 8231f78228bc
parent 459820 2525c940dd21
child 459831 ee6e77950205
child 459832 60cf625574a9
push id35574
push usercbrindusan@mozilla.com
push dateTue, 19 Feb 2019 04:38:09 +0000
treeherdermozilla-central@8231f78228bc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmossop
bugs1528568
milestone67.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 1528568 - Add error handling for the call to nsIFile::Exists() in nsToolkitProfileService::SelectStartupProfile(); r=mossop Differential Revision: https://phabricator.services.mozilla.com/D20079
toolkit/profile/nsToolkitProfileService.cpp
--- a/toolkit/profile/nsToolkitProfileService.cpp
+++ b/toolkit/profile/nsToolkitProfileService.cpp
@@ -1052,16 +1052,17 @@ nsresult nsToolkitProfileService::Select
         profile->GetRootDir(getter_AddRefs(rootDir));
 
         nsCOMPtr<nsIFile> compat;
         rootDir->Clone(getter_AddRefs(compat));
         compat->Append(COMPAT_FILE);
 
         bool exists;
         rv = compat->Exists(&exists);
+        NS_ENSURE_SUCCESS(rv, rv);
 
         // If the file is missing then either this is an empty profile (likely
         // generated by bug 1518591) or it is from an ancient version. We'll opt
         // to leave it for older versions in this case.
         if (exists) {
           if (MaybeMakeDefaultDedicatedProfile(profile)) {
             mStartupReason = NS_LITERAL_STRING("firstrun-claimed-default");