diff --git a/src/Http/Middleware/ShareInertiaData.php b/src/Http/Middleware/ShareInertiaData.php index 13d29942c..04eecc1c2 100644 --- a/src/Http/Middleware/ShareInertiaData.php +++ b/src/Http/Middleware/ShareInertiaData.php @@ -30,6 +30,10 @@ public function handle($request, $next) ]; }, 'user' => function () use ($request) { + if (! $request->user()) { + return; + } + if (Jetstream::hasTeamFeatures() && $request->user()) { $request->user()->currentTeam; }