From 0fd0b918d0d96481e1aecd6725c32cf9014b78f2 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Tue, 28 Mar 2017 14:10:10 +0200 Subject: [PATCH] Remove Notice --- library/Metier/Liens/Base.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/library/Metier/Liens/Base.php b/library/Metier/Liens/Base.php index 0ca90f7c..7b083be5 100755 --- a/library/Metier/Liens/Base.php +++ b/library/Metier/Liens/Base.php @@ -208,8 +208,10 @@ class Metier_Liens_Base $sql = "SELECT LPAD(siren, 9, 0) AS siren FROM jo.liensRef WHERE id = :id"; $stmt = $this->conn->prepare($sql); $stmt->bindValue('id', $this->idRef); - $result = $stmt->fetch(\PDO::FETCH_OBJ); - $siren = $result->siren; + if ($stmt->rowCount() > 0) { + $result = $stmt->fetch(\PDO::FETCH_OBJ); + $siren = $result->siren; + } } else { $siren = $this->siren; }