Better check on object (use instanceof wherever possible)
authorRoland Haeder <roland@mxchange.org>
Fri, 2 Sep 2016 19:08:48 +0000 (21:08 +0200)
committerRoland Haeder <roland@mxchange.org>
Fri, 2 Sep 2016 19:08:48 +0000 (21:08 +0200)
Signed-off-by: Roland Haeder <roland@mxchange.org>
classes/Profile.php

index 7aae98fb5f171e698ac73cb0dba13c8eab51e99d..74535a16bdcf65ae1e7c4816f6796f67e47fc4ed 100644 (file)
@@ -1067,7 +1067,7 @@ class Profile extends Managed_DataObject
             // Check if user has a personal setting for this
             $prefs = User_location_prefs::getKV('user_id', $this->id);
 
-            if (!empty($prefs)) {
+            if ($prefs instanceof User_location_prefs) {
                 $share = $prefs->share_location;
                 $prefs->free();
             }