Check input for the null pointer and empty string, bug 17287, r=ducarroz,jefft.

git-svn-id: svn://10.0.0.236/trunk@52109 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
nhotta%netscape.com 1999-10-28 20:41:45 +00:00
parent ce3c186894
commit b6d38ed4f7

View File

@ -96,6 +96,10 @@ nsSaveAsCharset::Convert(const PRUnichar *inString, char **_retval)
{
if (nsnull == _retval)
return NS_ERROR_NULL_POINTER;
if (nsnull == inString)
return NS_ERROR_NULL_POINTER;
if (0 == *inString)
return NS_ERROR_ILLEGAL_VALUE;
nsresult rv;
if (NULL == mEncoder) return NS_ERROR_FAILURE; // need to call Init() before Convert()