Followup to bug 392251 - try to fix Ts regression by checking for directory existence before trying to enumerate it, r=dcamp on IRC

This commit is contained in:
benjamin@smedbergs.us 2007-08-27 10:01:10 -07:00
Родитель a2637d1b98
Коммит 4218d9d806
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -551,6 +551,10 @@ LoadAppBundlesIntoArray(nsIFile* aXULAppDir,
dir->AppendNative(NS_LITERAL_CSTRING("distribution"));
dir->AppendNative(NS_LITERAL_CSTRING("bundles"));
PRBool exists;
if (NS_FAILED(dir->Exists(&exists)) || !exists)
return;
nsCOMPtr<nsISimpleEnumerator> e;
rv = dir->GetDirectoryEntries(getter_AddRefs(e));
if (NS_FAILED(rv))
@ -573,7 +577,6 @@ LoadAppBundlesIntoArray(nsIFile* aXULAppDir,
++a;
}
PRBool exists;
rv = subdir->Exists(&exists);
if (NS_SUCCEEDED(rv) && exists)
aDirectories.AppendObject(subdir);