mirror of
https://github.com/flarum/framework.git
synced 2025-01-19 18:12:59 +08:00
Fix error if there is no included data with user
i.e. if the logged in user is unconfirmed (doesn’t have any groups attached)
This commit is contained in:
parent
47262c2970
commit
193bb0b085
|
@ -33,8 +33,12 @@ class IndexAction extends Action
|
|||
];
|
||||
|
||||
$response = $this->callAction('Flarum\Api\Actions\Users\ShowAction', ['id' => $user->id]);
|
||||
$response = $response->getData();
|
||||
|
||||
$data = array_merge([$response->getData()->data], $response->getData()->included);
|
||||
$data = [$response->data];
|
||||
if (isset($response->included)) {
|
||||
$data = array_merge($data, $response->included);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user