From 142d6d5b8cc8132863ef044de36c516119ae690e Mon Sep 17 00:00:00 2001 From: Jacson Passold Date: Mon, 16 Apr 2018 16:39:46 -0300 Subject: [PATCH] avoid type mapper test if do not have a type --- src/exposers/class-tainacan-exposers.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/exposers/class-tainacan-exposers.php b/src/exposers/class-tainacan-exposers.php index 6a97e58d8..a9bc79d60 100644 --- a/src/exposers/class-tainacan-exposers.php +++ b/src/exposers/class-tainacan-exposers.php @@ -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; }