]> git.mxchange.org Git - friendica.git/commitdiff
If no record is found, below $r[0] will fail with a E_NOTICE and the code
authorRoland Häder <roland@mxchange.org>
Sun, 22 Jul 2018 16:13:13 +0000 (18:13 +0200)
committerRoland Häder <roland@mxchange.org>
Sun, 12 Aug 2018 21:16:45 +0000 (23:16 +0200)
doesn't behave as expected.

src/Model/GContact.php

index eb93c55ce6498a88e4b1219f9be0eada23540ea5..efb4b6a401e7955b6894fe0a66566ea5f7ee7851 100644 (file)
@@ -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"]]
                );