diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 89ba7147694..4dd675f9a28 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -8779,7 +8779,7 @@ function complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, if (class_exists($classtoload)) { $obj = new $classtoload($db); $function = $labeltemp[3]; - if (method_exists($obj, $function)) { + if ($obj && $function && method_exists($obj, $function)) { $nbrec = $obj->$function($object->id, $obj); $label .= ''.$nbrec.''; }