From a54cb2c9a1afe18126ac839b9c2d2f233c7d516c Mon Sep 17 00:00:00 2001 From: liugq Date: Mon, 25 Sep 2023 18:09:55 +0800 Subject: [PATCH] fix nil pointer (#164) Reviewed-on: https://git.infini.ltd:64443/infini/console/pulls/164 Co-authored-by: liugq Co-committed-by: liugq --- plugin/task_manager/common_api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/task_manager/common_api.go b/plugin/task_manager/common_api.go index 6d6bf075..4400cf7b 100644 --- a/plugin/task_manager/common_api.go +++ b/plugin/task_manager/common_api.go @@ -471,7 +471,7 @@ func (h *APIHandler) calcRepeatingStatus(taskItem *task.Task) (*task.Task, *Repe ret.LastRunTime = lastRepeatingChild.StartTimeInMillis if ret.LastRunTime == 0 && lastRunChild != nil { ret.LastRunTime = lastRunChild.StartTimeInMillis - if !lastRunChild.CompletedTime.IsZero(){ + if lastRunChild.CompletedTime != nil && !lastRunChild.CompletedTime.IsZero(){ ret.LastCompleteTime = lastRunChild.CompletedTime.UnixMilli() } }