Skip to content

Firefly III: a personal finances manager

Fix division by zero. [skip ci]

James Colef1a7f301679d
diff --git a/app/Repositories/Tag/TagRepository.php b/app/Repositories/Tag/TagRepository.php
index ee0e6fe374..3c9b9728c3 100644
--- a/app/Repositories/Tag/TagRepository.php
+++ b/app/Repositories/Tag/TagRepository.php
@@ -340,12 +340,12 @@ class TagRepository implements TagRepositoryInterface
$amountDiff = $max - $min;
$diff = $range[1] - $range[0];
$step = 1;
- if ($diff !== 0) {
+ if ($diff != 0) {
$step = $amountDiff / $diff;
}
-
$extra = round($amount / $step);
+
return intval($range[0] + $extra);
}
}