Initialize a variable to null. Assert if we are unable to create an instance of the prefs service.

This commit is contained in:
mscott%netscape.com 1999-03-22 23:27:44 +00:00
Родитель de6b2b6673
Коммит adfd87b89a
1 изменённых файлов: 3 добавлений и 1 удалений

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

@ -65,7 +65,7 @@ void nsMsgIdentity::InitializeIdentity()
#define PREF_LENGTH 128 #define PREF_LENGTH 128
char prefValue[PREF_LENGTH]; char prefValue[PREF_LENGTH];
PRInt32 prefLength = PREF_LENGTH; PRInt32 prefLength = PREF_LENGTH;
nsIPref* prefs; nsIPref* prefs = nsnull;
nsresult rv; nsresult rv;
rv = nsServiceManager::GetService(kPrefCID, kIPrefIID, (nsISupports**)&prefs); rv = nsServiceManager::GetService(kPrefCID, kIPrefIID, (nsISupports**)&prefs);
if (prefs && NS_SUCCEEDED(rv)) if (prefs && NS_SUCCEEDED(rv))
@ -124,6 +124,8 @@ void nsMsgIdentity::InitializeIdentity()
nsServiceManager::ReleaseService(kPrefCID, prefs); nsServiceManager::ReleaseService(kPrefCID, prefs);
} }
else
NS_ASSERTION(0, "unable to create the prefs service!!");
} }
nsresult nsMsgIdentity::GetPopName(const char ** aUserName) nsresult nsMsgIdentity::GetPopName(const char ** aUserName)