diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 91da8072922a9..6ac9619024554 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -419,7 +419,7 @@ function get_substitutionarray_object($object,$outputlangs,$array_key='object') } // Fetch project information if there is a project assigned to this object - if ($object->element != "project" && $object->fk_project > 0) + if ($object->element != "project" && ! empty($object->fk_project) && $object->fk_project > 0) { if(!isset($object->project)) {