Skip to content

Commit

Permalink
fix: ignore invalid jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
ismay committed Oct 19, 2023
1 parent ce1dc24 commit ad67116
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/components/JobTable/JobTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,13 @@ const JobTable = ({ jobs, refetch }) => (
</TableRow>
) : (
jobs.map((job) => {
/**
* This will fail if job.sequence.length does not exist. That should not happen,
* so failing with an error when it does is appropriate.
*/
const isValid = !!job?.sequence?.length

if (!isValid) {
return null
}

// A queue will have more than one item in .sequence
const isJob = job.sequence.length === 1

return (
Expand Down

0 comments on commit ad67116

Please sign in to comment.