Skip to content

Commit

Permalink
fix cat loading error in $u->should_receive_support_notifications
Browse files Browse the repository at this point in the history
In my fix for #2315 I inadvertently introduced a bug, which wasn't
caught until @rahaeli reported spotting the following TheSchwartz error:

Can't use string ("12") as a HASH ref while "strict refs" in use at /home/dw/production/cgi-bin/LJ/Support.pm line 263.

This patch should fix the problem, BUT I haven't been able to test it.
  • Loading branch information
kareila authored and alierak committed Apr 9, 2024
1 parent dd86605 commit e517a9d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cgi-bin/LJ/User/Permissions.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1294,8 +1294,9 @@ sub should_receive_support_notifications {
return 0 unless $u->is_visible;
return 0 unless $u->is_validated;
return 0 unless $spcatid;
return 0 unless LJ::Support::can_read_cat( $spcatid, $u );
return 1;

my $cat = LJ::Support::load_cats($spcatid)->{$spcatid};
return LJ::Support::can_read_cat( $cat, $u );
}

sub support_points_count {
Expand Down

0 comments on commit e517a9d

Please sign in to comment.