Skip to content

Commit

Permalink
allUsers may error if owner is null
Browse files Browse the repository at this point in the history
`Team->allUsers()` may error out, if `$this->owner` is `null`. This may happen if user was deleted (team owner has no foreign index). In this case `$this->users->merge([null])` which errors.
  • Loading branch information
dorkster100 committed Aug 29, 2024
1 parent de07bd9 commit f908b78
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Team.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ public function owner()
*/
public function allUsers()
{
return $this->users->merge([$this->owner]);
return $this->owner ?
$this->users->merge([$this->owner]) :
$this->users;
}

/**
Expand Down

0 comments on commit f908b78

Please sign in to comment.