From 655e0576260b74014731280826c43c0417cb1f20 Mon Sep 17 00:00:00 2001 From: "Barry vd. Heuvel" Date: Mon, 6 Jan 2025 16:29:58 +0100 Subject: [PATCH] Fix empty closure --- php-templates/auth.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/php-templates/auth.php b/php-templates/auth.php index d26a694..87e4b6a 100644 --- a/php-templates/auth.php +++ b/php-templates/auth.php @@ -6,7 +6,8 @@ return collect(Illuminate\Support\Facades\Gate::abilities()) $policyClass = null; - if (get_class($reflection->getClosureThis()) === Illuminate\Auth\Access\Gate::class) { + $closureThis = $reflection->getClosureThis(); + if ($closureThis && get_class($closureThis) === Illuminate\Auth\Access\Gate::class) { $vars = $reflection->getClosureUsedVariables(); if (isset($vars['callback'])) {