зеркало из https://github.com/mozilla/gecko-dev.git
Bug 247427 followup fix: ensure file exists before trying to open it, patch by O. Atsushi (Torisugari) <torisugari@gmail.com>, r+a=bsmedberg
This commit is contained in:
Родитель
99b46a5719
Коммит
6d0928efa1
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче