Bug 395618. UseUserPrefFile should check that user.js exists. r/sr/a=bsmedberg

This commit is contained in:
sayrer@gmail.com 2007-09-15 12:32:51 -07:00
parent 7bbc927612
commit 54c5519023

View File

@ -352,7 +352,13 @@ nsresult nsPrefService::UseUserPrefFile()
if (NS_SUCCEEDED(rv) && aFile) {
rv = aFile->AppendNative(NS_LITERAL_CSTRING("user.js"));
if (NS_SUCCEEDED(rv)) {
rv = openPrefFile(aFile);
PRBool exists = PR_FALSE;
aFile->Exists(&exists);
if (exists) {
rv = openPrefFile(aFile);
} else {
rv = NS_ERROR_FILE_NOT_FOUND;
}
}
}
return rv;