FIX : better test on fetch

This commit is contained in:
gauthier 2019-01-31 11:53:10 +01:00
parent 0c4e5a6487
commit bfc7265cbc
2 changed files with 3 additions and 3 deletions

View File

@ -578,7 +578,7 @@ class Adherent extends CommonObject
$lthirdparty=new Societe($this->db);
$result=$lthirdparty->fetch($this->fk_soc);
if ($result >= 0)
if ($result > 0)
{
$lthirdparty->address=$this->address;
$lthirdparty->zip=$this->zip;
@ -600,7 +600,7 @@ class Adherent extends CommonObject
$error++;
}
}
else
elseif(!empty($lthirdparty->error))
{
$this->error=$lthirdparty->error;
$error++;

View File

@ -1485,7 +1485,7 @@ class User extends CommonObject
$adh=new Adherent($this->db);
$result=$adh->fetch($this->fk_member);
if ($result > 0 && $adh->entity == $conf->entity)
if ($result > 0)
{
$adh->firstname=$this->firstname;
$adh->lastname=$this->lastname;