FIX: Missing return 0 if object not found

This commit is contained in:
Noé Courtier 2022-10-19 11:53:17 +02:00
parent c727ebd9dd
commit 477f5e2890
2 changed files with 11 additions and 0 deletions

View File

@ -4138,6 +4138,12 @@ class OrderLine extends CommonOrderLine
$result = $this->db->query($sql);
if ($result) {
$objp = $this->db->fetch_object($result);
if (!$objp) {
$this->error = 'OrderLine with id '. $rowid .' not found sql='.$sql;
return 0;
}
$this->rowid = $objp->rowid;
$this->id = $objp->rowid;
$this->fk_commande = $objp->fk_commande;

View File

@ -5293,6 +5293,11 @@ class FactureLigne extends CommonInvoiceLine
if ($result) {
$objp = $this->db->fetch_object($result);
if (!$objp) {
$this->error = 'InvoiceLine with id '. $rowid .' not found sql='.$sql;
return 0;
}
$this->rowid = $objp->rowid;
$this->id = $objp->rowid;
$this->fk_facture = $objp->fk_facture;