1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 08:21:34 +02:00

Ensure time log is iterable

This commit is contained in:
David Bomba 2023-09-24 12:16:51 +10:00
parent 611f43911e
commit 772ede661d

View File

@ -80,8 +80,8 @@ class UpdateCalculatedFields
$project->tasks->each(function ($task) use (&$duration) {
foreach(json_decode($task->time_log) as $log){
if(is_iterable($task->time_log)) {
foreach(json_decode($task->time_log) as $log) {
$start_time = $log[0];
$end_time = $log[1] == 0 ? time() : $log[1];
@ -89,6 +89,7 @@ class UpdateCalculatedFields
$duration += $end_time - $start_time;
}
}
});