avoid type mapper test if do not have a type

This commit is contained in:
Jacson Passold 2018-04-16 16:39:46 -03:00
parent 8474a5f1f0
commit 142d6d5b8c
1 changed files with 1 additions and 1 deletions

View File

@ -218,7 +218,7 @@ class Exposers {
$mapper = $Tainacan_Exposers->check_class_name($body['exposer-map'], true, self::MAPPER_CLASS_PREFIX);
return new $mapper;
}
} elseif( is_array($type->mappers) && count($type->mappers) > 0 ) { //there are no defined mapper, let use the first one o list if has a list
} elseif( is_object($type) && is_array($type->mappers) && count($type->mappers) > 0 ) { //there are no defined mapper, let use the first one o list if has a list
$mapper = $Tainacan_Exposers->check_class_name($type->mappers[0], true, self::MAPPER_CLASS_PREFIX);
return new $mapper;
}