account for possibly empty / null list-type attributes

This commit is contained in:
Russell Horton 2012-08-28 15:16:28 -07:00
parent bbb7e7138c
commit 153de3077e

View File

@ -148,6 +148,10 @@ class APIClient {
*/ */
public static function deserialize($object, $class) { public static function deserialize($object, $class) {
if (gettype($object) == "NULL") {
return $object;
}
if (substr($class, 0, 6) == 'array[') { if (substr($class, 0, 6) == 'array[') {
$sub_class = substr($class, 6, -1); $sub_class = substr($class, 6, -1);
$sub_objects = array(); $sub_objects = array();