mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
Ensure time log is iterable
This commit is contained in:
parent
611f43911e
commit
772ede661d
@ -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;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user