From 8f385bcef0a760b2a05c095c43c4ae74f133900b Mon Sep 17 00:00:00 2001 From: "sspitzer%netscape.com" Date: Wed, 11 Oct 2000 02:12:11 +0000 Subject: [PATCH] fixes for rtm++ bugs #55955 and #55444. on mac, migrate if the MagicCookies files doesn't exist. on mac, migrate if the "Mail" or "News" directories don't exist. r=putterman,sr=mscott --- profile/pref-migrator/src/nsPrefMigration.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/profile/pref-migrator/src/nsPrefMigration.cpp b/profile/pref-migrator/src/nsPrefMigration.cpp index 59f8243e9924..ffcb6b690ca9 100644 --- a/profile/pref-migrator/src/nsPrefMigration.cpp +++ b/profile/pref-migrator/src/nsPrefMigration.cpp @@ -1706,6 +1706,9 @@ Fix4xCookies(nsIFileSpec * profilePath) { nsFileSpec oldCookies(profileDirectory); oldCookies += COOKIES_FILE_NAME_IN_4x; + /* it is possible that the 4.x cookies file does not exist. just return normally. see #55444 */ + if (!oldCookies.Exists()) return NS_OK; + nsInputFileStream inStream(oldCookies); if (!inStream.is_open()) { return NS_ERROR_FAILURE; @@ -2054,6 +2057,12 @@ nsPrefMigration::SetPremigratedFilePref(const char *pref_name, nsIFileSpec *path rv = NS_FileSpecToIFile(&pathSpec, getter_AddRefs(pathFile)); if (NS_FAILED(rv)) return rv; + PRBool exists = PR_FALSE; + pathFile->Exists(&exists); + + NS_ASSERTION(exists, "the path does not exist. see bug #55444"); + if (!exists) return NS_OK; + rv = m_prefs->SetFileXPref((const char *)premigration_pref, pathFile); return rv; }