diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 3137b5bd647..541d9271ade 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -51,9 +51,14 @@ $object = new Project($db); $extrafields = new ExtraFields($db); if ($id > 0 || ! empty($ref)) { - $object->fetch($id,$ref); - $object->fetch_thirdparty(); - $id=$object->id; + $ret = $object->fetch($id,$ref); + if ($ret > 0) { + $object->fetch_thirdparty(); + $id=$object->id; + } else { + setEventMessage($object->error, 'errors'); + $action=''; + } } // Security check