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)
This commit is contained in:
Brion Vibber 2010-01-12 12:26:08 -08:00
parent 4cc9b183d7
commit 2b10e359fe
1 changed files with 1 additions and 1 deletions

View File

@ -168,7 +168,7 @@ class ApiAction extends Action
$timezone = 'UTC';
if ($user->timezone) {
if (!empty($user) && $user->timezone) {
$timezone = $user->timezone;
}