From 378842e05f65d7fbab1d28cc705a846efc9bbe6e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 31 Jul 2013 11:27:56 +0200 Subject: [PATCH] Fix: Better error management --- htdocs/contrat/fiche.php | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php index 3cc5824ddc5..2bfcbf0a726 100644 --- a/htdocs/contrat/fiche.php +++ b/htdocs/contrat/fiche.php @@ -916,20 +916,14 @@ else if ($id > 0 || ! empty($ref)) { $result=$object->fetch($id,$ref); - if ($result > 0) - { - $result=$object->fetch_lines(); - } - if ($result < 0) - { - dol_print_error($db,$object->error); - exit; - } + if ($result < 0) dol_print_error($db,$object->error); + $result=$object->fetch_lines(); + if ($result < 0) dol_print_error($db,$object->error); + $result=$object->fetch_thirdparty(); + if ($result < 0) dol_print_error($db,$object->error); dol_htmloutput_errors($mesg,''); - $object->fetch_thirdparty(); - $nbofservices=count($object->lines); $author = new User($db);