Bug 1548580 - Remove a startup warning in PermissionManager, r=Ehsan
authorAndrea Marchesini <amarchesini@mozilla.com>
Thu, 02 May 2019 16:28:14 +0000
changeset 531141 dca62b7804bf3ac2575af4e96cb0a7bad1cf5d2e
parent 531140 4e111da826529376e126b44cbdeabb5202da88d7
child 531142 cc36119ab2b4ce55fae2a6b2be5ec04734040591
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersEhsan
bugs1548580
milestone68.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 1548580 - Remove a startup warning in PermissionManager, r=Ehsan Differential Revision: https://phabricator.services.mozilla.com/D29682
extensions/permissions/nsPermissionManager.cpp
--- a/extensions/permissions/nsPermissionManager.cpp
+++ b/extensions/permissions/nsPermissionManager.cpp
@@ -1017,18 +1017,20 @@ nsresult nsPermissionManager::OpenDataba
 
 nsresult nsPermissionManager::InitDB(bool aRemoveFile) {
   nsCOMPtr<nsIFile> permissionsFile;
   nsresult rv = NS_GetSpecialDirectory(NS_APP_PERMISSION_PARENT_DIR,
                                        getter_AddRefs(permissionsFile));
   if (NS_FAILED(rv)) {
     rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR,
                                 getter_AddRefs(permissionsFile));
+    if (NS_FAILED(rv)) {
+      return NS_ERROR_UNEXPECTED;
+    }
   }
-  NS_ENSURE_SUCCESS(rv, NS_ERROR_UNEXPECTED);
 
   rv = permissionsFile->AppendNative(NS_LITERAL_CSTRING(PERMISSIONS_FILE_NAME));
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (aRemoveFile) {
     bool exists = false;
     rv = permissionsFile->Exists(&exists);
     NS_ENSURE_SUCCESS(rv, rv);