if (NS_FAILED(rv) || pPref == nsnull)
if (NS_FAILED(rv) || !pPref)
static PRInt32 PR_CALLBACK dir_ServerPrefCallback(const char *prefname, void *inst_data){    nsresult rv = NS_OK;    NS_WITH_SERVICE(nsIPref, pPref, kPrefCID, &rv);     if (NS_FAILED(rv) || pPref == nsnull) 		return NS_ERROR_FAILURE;	DIR_PrefId id = DIR_AtomizePrefName(prefname);	/* Check to see if the server is in the unified server list.	 */	DIR_Server *server = dir_MatchServerPrefToServer(dir_ServerList, prefname);	if (server)	{		/* If the server is in the process of being saved, just ignore this		 * change.  The DIR_Server structure is not really changing.		 */		if (DIR_TestFlag(server, DIR_SAVING_SERVER))		    return NS_OK;		/* Reparse the root DSE if one of the following attributes changed.		 */		if (   id == idServerName || id == idSearchBase			|| id == idEnableAuth || id == idAuthDn || id == idPassword)			DIR_ClearFlag(server, DIR_LDAP_ROOTDSE_PARSED);		/* If the pref that changed is the position, read it in.  If the new		 * position is zero, remove the server from the list.		 */		if (id == idPosition)		{			PRInt32 position;			/* We must not do anything if the new position is the same as the			 * position in the DIR_Server.  This avoids recursion in cases			 * where we are deleting the server.			 */			pPref->GetIntPref(prefname, &position);			if (position != server->position)			{				server->position = position;				if (dir_IsServerDeleted(server))					DIR_SetServerPosition(dir_ServerList, server, DIR_POS_DELETE);				else					DIR_SendNotification(server, DIR_NOTIFY_PROPERTY_CHANGE, idPosition);			}		}		/* Some pref other position changed, reload the server and send a property		 * changed notification.		 */		else if (dir_CallbackList != nsnull)		{			DIR_GetPrefsForOneServer(server, PR_TRUE, PR_FALSE);			DIR_SendNotification(server, DIR_NOTIFY_PROPERTY_CHANGE, id);		}	}	/* If the server is not in the unified list, we may need to add it.  Servers	 * are only added when the position, serverName and description are valid.	 */	else	{		if (id == idPosition || id == idType || id == idServerName || id == idDescription)			dir_ValidateAndAddNewServer(dir_ServerList, prefname);	}    return NS_OK;}