Bug 531532 - Crash for profiles with a non-existent non-relative profile location. r=bsmedberg a=beltzner

This commit is contained in:
Gabriele Best 2009-12-02 20:00:56 +01:00
parent e9f3f00f0e
commit 6c90a80ad0

View File

@ -2012,6 +2012,14 @@ SelectProfile(nsIProfileLock* *aResult, nsINativeAppSupport* aNative,
nsCOMPtr<nsIProfileUnlocker> unlocker;
// Check if the profile path exists and it's a directory.
PRBool exists;
lf->Exists(&exists);
if (!exists) {
rv = lf->Create(nsIFile::DIRECTORY_TYPE, 0644);
NS_ENSURE_SUCCESS(rv, rv);
}
// If a profile path is specified directory on the command line, then
// assume that the temp directory is the same as the given directory.
rv = NS_LockProfilePath(lf, lf, getter_AddRefs(unlocker), aResult);