Fixed rare case of division by 0

This commit is contained in:
VeekeeFr
2018-10-12 01:52:26 +02:00
parent 48769d7e7c
commit 906024f45b

View File

@@ -74,7 +74,11 @@ class StatusPageController extends AbstractApiController
->values();
$numIncidentDays = count($allIncidentDays);
$numPages = round($numIncidentDays / $appIncidentDays);
if ($appIncidentDays > 0) {
$numPages = round($numIncidentDays / $appIncidentDays);
} else {
$numPages = 1;
}
$selectedDays = $allIncidentDays->slice($page * $appIncidentDays, $appIncidentDays)->all();