Skip to content

Commit

Permalink
fixed award delete error 500 of no user is logged in
Browse files Browse the repository at this point in the history
  • Loading branch information
Talpx1 committed Feb 20, 2023
1 parent e757997 commit 94c9028
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Http/Controllers/AwardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function update(UpdateAwardRequest $request, Award $award){
* @return \Illuminate\Http\JsonResponse
*/
public function destroy(Award $award){
if(!Auth::user()->can(Permissions::DESTROY_AWARD->value)) abort(403);
if(!Auth::user()?->can(Permissions::DESTROY_AWARD->value) ?? false) abort(403);

$award->deleteIconFiles();
$award->delete();
Expand Down

0 comments on commit 94c9028

Please sign in to comment.