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:
parent
600bfe072d
commit
24afe8e36e
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue