From: Roland Häder <roland@mxchange.org>
Date: Sun, 22 Jul 2018 16:13:13 +0000 (+0200)
Subject: If no record is found, below $r[0] will fail with a E_NOTICE and the code
X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c82b184c1061c9c7a5aa2e1a4fa087a3efa4a32c;p=friendica.git

If no record is found, below $r[0] will fail with a E_NOTICE and the code
doesn't behave as expected.
---

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"]]
 		);