diff --git a/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp b/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp index 0b6a6fa06755..f1973602ee1e 100644 --- a/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp +++ b/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp @@ -2168,22 +2168,18 @@ nsresult nsUrlClassifierDBService::LookupURI( if (forceLookup) { *didLookup = true; } else { - bool clean = false; - - if (!clean) { - nsCOMPtr permissionManager = - services::GetPermissionManager(); - - if (permissionManager) { - uint32_t perm; - rv = permissionManager->TestPermissionFromPrincipal( - aPrincipal, "safe-browsing", &perm); - NS_ENSURE_SUCCESS(rv, rv); - - clean |= (perm == nsIPermissionManager::ALLOW_ACTION); - } + nsCOMPtr permissionManager = + services::GetPermissionManager(); + if (NS_WARN_IF(!permissionManager)) { + return NS_ERROR_FAILURE; } + uint32_t perm; + rv = permissionManager->TestPermissionFromPrincipal( + aPrincipal, "safe-browsing", &perm); + NS_ENSURE_SUCCESS(rv, rv); + + bool clean = (perm == nsIPermissionManager::ALLOW_ACTION); *didLookup = !clean; if (clean) { return NS_OK;