Page 1 of 1

sendXtMessage raw string null error

Posted: 16 Apr 2010, 19:09
by vazor
When you have a null value in your array for the STR message format, instead of getting empty string or "null" as expected, SmartFoxClient throws a null error:
paramObj.toString()
The code might be better to do a cast instead of calling the function:
String(paramObj)
or just leave it off completely since it will be converted to a string anyway.

However I guess I see the advantage in leaving it this way because "null" isn't exactly an expected value either. Best to let the coder know they are doing something silly by putting null. I have worked around this by checking for null and using empty string instead.
-vazor