Bug #284699 --> add some null ptr protection to avoid a crash

sr=bienvenu
This commit is contained in:
scott%scott-macgregor.org 2005-04-13 21:45:13 +00:00
Родитель a25dbaca79
Коммит dc0b1daba0
1 изменённых файлов: 4 добавлений и 0 удалений

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

@ -362,21 +362,25 @@ nsSeamonkeyProfileMigrator::FillProfileDataFromSeamonkeyRegistry()
nsCOMPtr<nsILocalFile> seamonkeyRegistry;
#ifdef XP_WIN
fileLocator->Get(NS_WIN_APPDATA_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(seamonkeyRegistry));
NS_ENSURE_TRUE(seamonkeyRegistry, NS_ERROR_FAILURE);
seamonkeyRegistry->Append(NS_LITERAL_STRING("Mozilla"));
seamonkeyRegistry->Append(NS_LITERAL_STRING("registry.dat"));
#elif defined(XP_MACOSX)
fileLocator->Get(NS_MAC_USER_LIB_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(seamonkeyRegistry));
NS_ENSURE_TRUE(seamonkeyRegistry, NS_ERROR_FAILURE);
seamonkeyRegistry->Append(NS_LITERAL_STRING("Mozilla"));
seamonkeyRegistry->Append(NS_LITERAL_STRING("Application Registry"));
#elif defined(XP_UNIX)
fileLocator->Get(NS_UNIX_HOME_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(seamonkeyRegistry));
NS_ENSURE_TRUE(seamonkeyRegistry, NS_ERROR_FAILURE);
seamonkeyRegistry->Append(NS_LITERAL_STRING(".mozilla"));
seamonkeyRegistry->Append(NS_LITERAL_STRING("appreg"));
#elif defined(XP_OS2)
fileLocator->Get(NS_OS2_HOME_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(seamonkeyRegistry));
NS_ENSURE_TRUE(seamonkeyRegistry, NS_ERROR_FAILURE);
seamonkeyRegistry->Append(NS_LITERAL_STRING("Mozilla"));
seamonkeyRegistry->Append(NS_LITERAL_STRING("registry.dat"));