fix(database): guard proxy listeners without a team

This commit is contained in:
Andras Bacsai committed 2026-05-28 17:13:18 +02:00
1 parent 27b76a4e97
commit c35d28f99b
4 files changed
+32 -11

No files matched your search

@@ -40,12 +40,19 @@ class General extends Component
public bool $isLogDrainEnabled = false;
public function getListeners()
public function getListeners(): array
{
$teamId = Auth::user()->currentTeam()->id;
$user = Auth::user();
if (! $user) {
return [];
}
$team = $user->currentTeam();
if (! $team) {
return [];
}
return [
"echo-private:team.{$teamId},DatabaseProxyStopped" => 'databaseProxyStopped',
"echo-private:team.{$team->id},DatabaseProxyStopped" => 'databaseProxyStopped',
];
}