Please see the code below:
Code: Select all
public void OnExtensionResponse(object data, string type)
{
if (type == SmartFoxClient.XTMSG_TYPE_JSON)
{
JsonData responseObject = (JsonData)data;
if(responseObject[key] != null)
{
value = responseObject[key];
}
}
}
If the key is not present, then a null reference exception is thrown. JSonData does not have a .Contains method either. How do I check if the object contains a certain key?
Thank you.