From 258fbf48bae1f49f4f3b58e6113253648eebb189 Mon Sep 17 00:00:00 2001 From: Newnius Date: Thu, 9 Jul 2020 21:38:06 +0800 Subject: [PATCH] bugfix --- job.logic.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/job.logic.php b/job.logic.php index 37763c6..9998f92 100644 --- a/job.logic.php +++ b/job.logic.php @@ -116,7 +116,11 @@ function job_list(CRObject $rule) return $res; } - $res['jobs'] = array_reverse($msg['jobs']); + if ($msg['jobs'] !== null) { + $res['jobs'] = array_reverse($msg['jobs']); + } else { + $res['jobs'] = []; + } for ($i = 0; $i < sizeof($res['jobs']); $i++) { $res['jobs'][$i]['tasks'] = json_encode($res['jobs'][$i]['tasks']); if ($res['jobs'][$i]['run_before'] === 0) {