diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index e4708a0e8ce..71961c72d3c 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -5372,8 +5372,7 @@ class Facture extends CommonInvoice $sql .= ' AND entity = '.($this->entity > 0 ? $this->entity : $conf->entity); $resql = $this->db->query($sql); - if ($resql && $this->db->num_rows($resql) > 0) { - $res = $this->db->fetch_array($resql); + if ($resql && $this->db->num_rows($resql) > 0 && $res = $this->db->fetch_array($resql)) { $last = $res['max(situation_counter)']; return ($last == $this->situation_counter); } else { diff --git a/htdocs/don/admin/donation.php b/htdocs/don/admin/donation.php index b88040c2ed7..9f7faf9b6ca 100644 --- a/htdocs/don/admin/donation.php +++ b/htdocs/don/admin/donation.php @@ -200,7 +200,9 @@ if ($resql) { $num_rows = $db->num_rows($resql); while ($i < $num_rows) { $array = $db->fetch_array($resql); - array_push($def, $array[0]); + if (is_array($array)) { + array_push($def, $array[0]); + } $i++; } } else { diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index a565fb86518..085b976f5ef 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -382,7 +382,9 @@ if ($resql) { $num_rows = $db->num_rows($resql); while ($i < $num_rows) { $array = $db->fetch_array($resql); - array_push($def, $array[0]); + if (is_array($array)) { + array_push($def, $array[0]); + } $i++; } } else { diff --git a/htdocs/projet/admin/project.php b/htdocs/projet/admin/project.php index 9e0da996d6e..f5fee2ef5a3 100644 --- a/htdocs/projet/admin/project.php +++ b/htdocs/projet/admin/project.php @@ -511,7 +511,9 @@ if ($resql) { $num_rows = $db->num_rows($resql); while ($i < $num_rows) { $array = $db->fetch_array($resql); - array_push($def, $array[0]); + if (is_array($array)) { + array_push($def, $array[0]); + } $i++; } } else {