From 2b10e359fea9d6aabc5ab35557954a503bea730b Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 12 Jan 2010 12:26:08 -0800 Subject: [PATCH] Avoid PHP notice when outputting API data for remote users; no $user means no $user->timezone :) Trying to get property of non-object (/srv/com.leuksman.status/lib/api.php:171) --- lib/api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/api.php b/lib/api.php index d21851d503..707e4ac21a 100644 --- a/lib/api.php +++ b/lib/api.php @@ -168,7 +168,7 @@ class ApiAction extends Action $timezone = 'UTC'; - if ($user->timezone) { + if (!empty($user) && $user->timezone) { $timezone = $user->timezone; } -- 2.39.5