Skip to content

Commit

Permalink
check msgOption is Valid before convert it to msg
Browse files Browse the repository at this point in the history
  • Loading branch information
w-zr committed Sep 2, 2024
1 parent bb45d0d commit 28e1a2f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pkg/taskservice/mysql_task_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,11 +386,13 @@ func (m *mysqlTaskStorage) QueryAsyncTask(ctx context.Context, condition ...Cond
}
t.ExecuteResult.Code = task.ResultCode(code.(int64))

msg, err := msgOption.Value()
if err != nil {
return nil, err
if msgOption.Valid {
msg, err := msgOption.Value()
if err != nil {
return nil, err
}
t.ExecuteResult.Error = msg.(string)
}
t.ExecuteResult.Error = msg.(string)
}

tasks = append(tasks, t)
Expand Down

0 comments on commit 28e1a2f

Please sign in to comment.