diff --git a/app/Repositories/TaskRepository.php b/app/Repositories/TaskRepository.php index 5269ca541e69..0c1e3aeaae9e 100644 --- a/app/Repositories/TaskRepository.php +++ b/app/Repositories/TaskRepository.php @@ -117,10 +117,15 @@ class TaskRepository extends BaseRepository } $key_values = array_column($time_log, 0); - array_multisort($key_values, SORT_ASC, $time_log); + + if(count($key_values) > 0) + array_multisort($key_values, SORT_ASC, $time_log); foreach($time_log as $key => $value) { - $time_log[$key][1] = $this->roundTimeLog($time_log[$key][0], $time_log[$key][1]); + + if(is_array($time_log[$key]) && count($time_log[$key]) >=2) + $time_log[$key][1] = $this->roundTimeLog($time_log[$key][0], $time_log[$key][1]); + } if (isset($data['action'])) {