1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-19 16:58:48 +02:00

Fix RuntimeException: min(): Array must contain at least one element

Summary:
Make sure that `$epochs[]` is never empty but contains `0` so `min($epochs)` will not complain.

Closes T15623

Test Plan: Carefully read the code (as I am unaware of reproduction steps).

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15623

Differential Revision: https://we.phorge.it/D25417
This commit is contained in:
Andre Klapper 2023-08-22 11:07:02 +02:00
parent 9b105c8e9e
commit beec08e019

View file

@ -198,6 +198,10 @@ final class DiffusionBlameController extends DiffusionController {
$map[$identifier] = $data;
}
if (empty($epochs)) {
$epochs[] = 0;
}
$epoch_min = min($epochs);
$epoch_max = max($epochs);