diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 2566ee81073..97bcef197e6 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -390,7 +390,7 @@ foreach ($search as $key => $val) { } continue; } - $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); + $mode_search = ((!empty($object->fields[$key]) && ($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key]))) ? 1 : 0); if ($search[$key] != '') { $sql .= natural_search($key, $search[$key], $mode_search); } @@ -560,7 +560,7 @@ if ($projectid > 0 || $project_ref) { // Title $morehtmlref .= $object->title; // Thirdparty - if ($object->thirdparty->id > 0) { + if (!empty($object->thirdparty) && $object->thirdparty->id > 0) { $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= '';