Fix 500 error on angeltypes edit page when logged out

This commit is contained in:
Igor Scheller 2023-07-14 11:24:48 +02:00 committed by Michael Weimann
parent db4c5eec1c
commit 24f958b00d
1 changed files with 1 additions and 1 deletions

View File

@ -92,7 +92,7 @@ function angeltype_edit_controller()
// Edit existing angeltype // Edit existing angeltype
$angeltype = AngelType::findOrFail($request->input('angeltype_id')); $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')); throw_redirect(page_link_to('angeltypes'));
} }
} else { } else {