diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index cc0465a0b68..dcd7eeefcd8 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -72,6 +72,12 @@ $extralabels=$extrafields->fetch_name_optionals_label($object->table_element); // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('thirdpartycard','globalcard')); +if ($action == 'view' && $object->fetch($socid)<=0) +{ + $langs->load("errors"); + print($langs->trans('ErrorRecordNotFound')); + exit; +} // Get object canvas (By default, this is not defined, so standard usage of dolibarr) $object->getCanvas($socid);