From c82b184c1061c9c7a5aa2e1a4fa087a3efa4a32c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 22 Jul 2018 18:13:13 +0200 Subject: [PATCH] If no record is found, below $r[0] will fail with a E_NOTICE and the code doesn't behave as expected. --- src/Model/GContact.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Model/GContact.php b/src/Model/GContact.php index eb93c55ce6..efb4b6a401 100644 --- a/src/Model/GContact.php +++ b/src/Model/GContact.php @@ -955,6 +955,11 @@ class GContact intval($uid) ); + if (!DBM::is_result($r)) { + logger('Cannot find user with uid=' . $uid, LOGGER_NORMAL); + return false; + } + $location = Profile::formatLocation( ["locality" => $r[0]["locality"], "region" => $r[0]["region"], "country-name" => $r[0]["country-name"]] ); -- 2.39.5