Add default values when parsing account data

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2018-12-19 07:38:01 +01:00
parent f5286bcb07
commit 0f911e2d13
No known key found for this signature in database
GPG key ID: 4C614C6ED2CDE6DF

View file

@ -330,7 +330,7 @@ class AccountManager implements IAccountManager {
private function parseAccountData(IUser $user, $data): Account {
$account = new Account($user);
foreach($data as $property => $accountData) {
$account->setProperty($property, $accountData['value'] ?? '', $accountData['scope'], $accountData['verified']);
$account->setProperty($property, $accountData['value'] ?? '', $accountData['scope'] ?? self::VISIBILITY_PRIVATE, $accountData['verified'] ?? self::NOT_VERIFIED);
}
return $account;
}