Bug 28530: (QA follow-up) Guard against divide by zero

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Martin Renvoize 2026-02-04 17:44:35 +00:00 committed by Lucas Gass
parent 600bfe072d
commit 24afe8e36e
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 2 additions and 1 deletions

View File

@ -187,7 +187,8 @@ sub lowest_ratio_library {
}
}
my $ratio = $item_count / $float_limit_val;
# Guard against division by zero (float_limit_val should never be 0 due to search filter, but be safe)
my $ratio = $float_limit_val > 0 ? $item_count / $float_limit_val : 999999;
push @candidates, {
branchcode => $branch,