diff --git a/profile/src/nsProfile.cpp b/profile/src/nsProfile.cpp index a21b2ef3e405..7f5a51f468a9 100644 --- a/profile/src/nsProfile.cpp +++ b/profile/src/nsProfile.cpp @@ -1266,7 +1266,13 @@ nsProfile::MigrateProfile(const PRUnichar* profileName, PRBool showProgressAsMod newSpec->GetFileSpec(&newProfDir); newProfDir += profileName; - + newProfDir.MakeUnique(); + if (newProfDir.Exists()) { +#ifdef DEBUG_profile + printf("directory already exists\n"); +#endif + return NS_ERROR_FAILURE; + } // Call migration service to do the work. nsCOMPtr pPrefMigrator;