From 24f958b00ddb28c3e6989562ef54ae649192be12 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Fri, 14 Jul 2023 11:24:48 +0200 Subject: [PATCH] Fix 500 error on angeltypes edit page when logged out --- includes/controller/angeltypes_controller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/controller/angeltypes_controller.php b/includes/controller/angeltypes_controller.php index dadb6c13..bf078a86 100644 --- a/includes/controller/angeltypes_controller.php +++ b/includes/controller/angeltypes_controller.php @@ -92,7 +92,7 @@ function angeltype_edit_controller() // Edit existing angeltype $angeltype = AngelType::findOrFail($request->input('angeltype_id')); - if (!auth()->user()->isAngelTypeSupporter($angeltype) && !auth()->can('admin_user_angeltypes')) { + if (!auth()->user()?->isAngelTypeSupporter($angeltype) && !auth()->can('admin_user_angeltypes')) { throw_redirect(page_link_to('angeltypes')); } } else {