]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Avoid PHP notice when outputting API data for remote users; no $user means no $user...
authorBrion Vibber <brion@pobox.com>
Tue, 12 Jan 2010 20:26:08 +0000 (12:26 -0800)
committerBrion Vibber <brion@pobox.com>
Tue, 12 Jan 2010 20:28:24 +0000 (12:28 -0800)
Trying to get property of non-object (/srv/com.leuksman.status/lib/api.php:171)

lib/api.php

index d21851d503c4bcb1ef14085c5dc899979d108757..707e4ac21a421ee75260fc4bb950e43c7727c8af 100644 (file)
@@ -168,7 +168,7 @@ class ApiAction extends Action
 
         $timezone = 'UTC';
 
-        if ($user->timezone) {
+        if (!empty($user) && $user->timezone) {
             $timezone = $user->timezone;
         }