Skip to content

Commit

Permalink
Check for all types of errors when fetchingTasks to prevent panics (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
ameowlia authored Apr 18, 2024
1 parent 8758af9 commit a7ed0dc
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions db/sqldb/task_db.go
Original file line number Diff line number Diff line change
Expand Up @@ -458,13 +458,18 @@ func (db *SQLDB) fetchTasks(ctx context.Context, logger lager.Logger, rows *sql.
var guid string

task, guid, err = db.fetchTaskInternal(logger, rows)
if err == models.ErrDeserialize {
invalidGuids = append(invalidGuids, guid)
if err != nil {
if err == models.ErrDeserialize {
invalidGuids = append(invalidGuids, guid)
}

if abortOnError {
break
}

continue
}

tasks = append(tasks, task)
validGuids = append(validGuids, task.TaskGuid)
}
Expand Down

0 comments on commit a7ed0dc

Please sign in to comment.