First, as a matter of good practices, I recommend using CJSON::decode(). IIRC, Its just a wrapper to json_decode() but its a good practice to follow to use the framework classes.
Indeed probably the json you’ve got does not indicate an error, and therefore does not contain the attribute you’re checking - and there goes your explosion.
You can check the existence of this attribute right before you’re checking its value, just as you suggested - with isset() php method.
Also note that json_decode has a second parameter $assoc which is "false" by default.
So if you use json_decode($data) it will return an object, but if you use json_decode($data, true) then it will return an associative array.
And Yii’s CJSON::decode() changes this default to “true”, so CJSON::decode($data) will return an array and CJSON::decode($data, false) will return an object.