Bug 247427 followup fix: ensure file exists before trying to open it, patch by O. Atsushi (Torisugari) <torisugari@gmail.com>, r+a=bsmedberg
git-svn-id: svn://10.0.0.236/trunk@177034 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -77,6 +77,13 @@ nsNetscapeProfileMigratorBase::GetProfileDataFromRegistry(nsILocalFile* aRegistr
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
// Ensure aRegistryFile exists before open it
|
||||
PRBool regFileExists = PR_FALSE;
|
||||
rv = aRegistryFile->Exists(®FileExists);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
if (!regFileExists)
|
||||
return NS_ERROR_FILE_NOT_FOUND;
|
||||
|
||||
// Open It
|
||||
nsCOMPtr<nsIRegistry> reg(do_CreateInstance("@mozilla.org/registry;1"));
|
||||
reg->Open(aRegistryFile);
|
||||
|
||||
Reference in New Issue
Block a user