Skip to content

Commit

Permalink
Prevent patrons from logging in on the exact minute of closing time #337
Browse files Browse the repository at this point in the history


This bug is due to a check for for "truthiness" of the minutes until
closing variable. The problem being that 0 is false so we never check to
see if it is 0 or less. Instead, we should be checking to see if the
variable is defined.
  • Loading branch information
kylemhall committed Oct 30, 2023
1 parent 12d01b2 commit 787b538
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Libki/Controller/API/Client/v1_0.pm
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ sub index : Path : Args(0) {
}

my $error = {}; # Must be initialized as a hashref
if ( $minutes_until_closing && $minutes_until_closing <= 0 )
if ( defined $minutes_until_closing && $minutes_until_closing <= 0 )
{
$c->stash( error => 'CLOSED' );
}
Expand Down

0 comments on commit 787b538

Please sign in to comment.