diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 11d67232c7..dd5ac4a2da 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -1356,7 +1356,7 @@ App::get('/v1/account/prefs') ->inject('user') ->action(function (Response $response, Document $user) { - $prefs = $user->getAttribute('prefs', new \stdClass()); + $prefs = $user->getAttribute('prefs', []); $response->dynamic(new Document($prefs), Response::MODEL_PREFERENCES); }); diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index 7e7e342de9..ceed901a32 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -457,7 +457,7 @@ App::get('/v1/users/:userId/prefs') throw new Exception(Exception::USER_NOT_FOUND); } - $prefs = $user->getAttribute('prefs', new \stdClass()); + $prefs = $user->getAttribute('prefs', []); $response->dynamic(new Document($prefs), Response::MODEL_PREFERENCES); });