if (NS_FAILED(rv) || pPref == nsnull)
if (NS_FAILED(rv) || !pPref)
static PRInt32 dir_GetPrefsFrom40Branch(nsVoidArray **list){    nsresult rv = NS_OK;    NS_WITH_SERVICE(nsIPref, pPref, kPrefCID, &rv);     if (NS_FAILED(rv) || pPref == nsnull) 		return -1;	PRInt32 result = -1;	(*list) = new nsVoidArray();	if (!(*list))		return result;	/* get the preference for how many directories */	if (*list)	{		PRInt32 i = 0;		PRInt32 numDirectories = 0; 		pPref->GetIntPref("ldap_1.number_of_directories", &numDirectories);			/* ldap_1.directory start from 1 */		for (i = 1; i <= numDirectories; i++)		{			DIR_Server *server;			server = (DIR_Server *)PR_Calloc(1, sizeof(DIR_Server));			if (server)			{				char *prefName = PR_smprintf("ldap_1.directory%i", i);				if (prefName)				{					DIR_InitServer(server);					server->prefName = prefName;					DIR_GetPrefsForOneServer(server, PR_FALSE, PR_TRUE);									PR_Free(server->prefName);					server->prefName = DIR_CreateServerPrefName (server, nsnull);					/* Leave room for Netcenter */					server->position = (server->dirType == PABDirectory ? i : i + 1);					(*list)->AppendElement(server);				}			}		}		/* all.js should have filled this stuff in */		PR_ASSERT(numDirectories != 0);		result = numDirectories;	}	return result;}