diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index fa59659ab31..e9498d52d7d 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1210,7 +1210,10 @@ abstract class CommonObject if ($resql) { $row = $this->db->fetch_row($resql); - $result = $this->fetch($row[0]); + // Test for avoid error -1 + if ($row[0] > 0) { + $result = $this->fetch($row[0]); + } } return $result;