diff --git a/htdocs/categories/class/api_categories.class.php b/htdocs/categories/class/api_categories.class.php index 3afc71477d67e..7b5bbc769cd33 100644 --- a/htdocs/categories/class/api_categories.class.php +++ b/htdocs/categories/class/api_categories.class.php @@ -797,7 +797,8 @@ public function getObjects($id, $type, $onlyids = 0) $objects_api = new Contacts(); } elseif ($type == 'project') { $objects_api = new Projects(); - } + } + if (is_object($objects_api)) { foreach ($objects as $obj) { $cleaned_objects[] = $objects_api->_cleanObjectDatas($obj);