Skip to content

Commit 766c966

Browse files
committed
Fix error on guests when fetching threads
1 parent e814c79 commit 766c966

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

backend/app/Services/Utils.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ public static function forumCategoriesFilter($q, bool $thread=false)
166166
}
167167

168168
// Moderate users can see all private threads
169-
if ($thread && !$user->hasPermission('moderate-users')) {
169+
if ($thread && (!isset($user) || !$user->hasPermission('moderate-users'))) {
170170
$q->where('private_threads', false)->orWhereHas('game', function($q) use($moderateUserGameRoles) {
171171
$q->whereIn('id', Arr::pluck($moderateUserGameRoles, 'game_id'));
172172
});

0 commit comments

Comments
 (0)