From 576359ed3a6d1df114bb8d039e6d624b4d6eec69 Mon Sep 17 00:00:00 2001 From: Tony Partridge Date: Mon, 19 Aug 2024 16:26:17 +0100 Subject: [PATCH 1/2] Ensure User is not null when getting default tenenat. --- packages/panels/src/Panel/Concerns/HasRoutes.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/panels/src/Panel/Concerns/HasRoutes.php b/packages/panels/src/Panel/Concerns/HasRoutes.php index f926ca489b..60b2fa6335 100644 --- a/packages/panels/src/Panel/Concerns/HasRoutes.php +++ b/packages/panels/src/Panel/Concerns/HasRoutes.php @@ -173,7 +173,7 @@ public function getUrl(?Model $tenant = null): ?string $hasTenancy = $this->hasTenancy(); - if ((! $tenant) && $hasTenancy) { + if ((! $tenant) && $hasTenancy && $this->auth()->user()) { $tenant = Filament::getUserDefaultTenant($this->auth()->user()); } From 6b20eafde2d43c1697bb296908fc98aec10fafe5 Mon Sep 17 00:00:00 2001 From: Dan Harrin Date: Tue, 20 Aug 2024 09:05:51 +0100 Subject: [PATCH 2/2] Update packages/panels/src/Panel/Concerns/HasRoutes.php --- packages/panels/src/Panel/Concerns/HasRoutes.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/panels/src/Panel/Concerns/HasRoutes.php b/packages/panels/src/Panel/Concerns/HasRoutes.php index 60b2fa6335..4bc973bbb5 100644 --- a/packages/panels/src/Panel/Concerns/HasRoutes.php +++ b/packages/panels/src/Panel/Concerns/HasRoutes.php @@ -173,7 +173,7 @@ public function getUrl(?Model $tenant = null): ?string $hasTenancy = $this->hasTenancy(); - if ((! $tenant) && $hasTenancy && $this->auth()->user()) { + if ((! $tenant) && $hasTenancy && $this->auth()->hasUser()) { $tenant = Filament::getUserDefaultTenant($this->auth()->user()); }