if (NS_FAILED(rv) || pPref == nsnull)
if (NS_FAILED(rv) || !pPref)
static void DIR_SetStringPref (const char *prefRoot, const char *prefLeaf, char *scratch, const char *value, const char *defaultValue){    nsresult rv = NS_OK;    NS_WITH_SERVICE(nsIPref, pPref, kPrefCID, &rv);     if (NS_FAILED(rv) || pPref == nsnull) 		return;	char *defaultPref = nsnull;	PRInt32 prefErr = PREF_NOERROR;	PL_strcpy(scratch, prefRoot);	PL_strcat(scratch, ".");	PL_strcat(scratch, prefLeaf);	if (PREF_NOERROR == pPref->CopyDefaultCharPref (scratch, &defaultPref))	{		/* If there's a default pref, just set ours in and let libpref worry 		 * about potential defaults in all.js		 */		 if (value) /* added this check to make sure we have a value before we try to set it..*/		 	prefErr = pPref->SetCharPref (scratch, value);		 else			 DIR_ClearStringPref(scratch);		PR_Free(defaultPref);	}	else	{		/* If there's no default pref, look for a user pref, and only set our value in		 * if the user pref is different than one of them.		 */		char *userPref = nsnull;		if (PREF_NOERROR == pPref->CopyCharPref (scratch, &userPref))		{			if (value && (defaultValue ? PL_strcasecmp(value, defaultValue) : value != defaultValue))				prefErr = pPref->SetCharPref (scratch, value);			else				DIR_ClearStringPref (scratch); 		}		else		{			if (value && (defaultValue ? PL_strcasecmp(value, defaultValue) : value != defaultValue))				prefErr = pPref->SetCharPref (scratch, value); 		}		PR_FREEIF(userPref);	}	PR_ASSERT(prefErr >= 0);}