Skip to content

Commit

Permalink
Ensure errors is an array
Browse files Browse the repository at this point in the history
resolves #607
  • Loading branch information
paustint committed Nov 13, 2023
1 parent d8e138e commit 21650bc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apps/jetstream/src/app/components/core/jobs/job-utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { AsyncJob, RecordResult, ErrorResult } from '@jetstream/types';
import { unparse } from 'papaparse';
import { saveFile } from '@jetstream/shared/ui-utils';
import { MIME_TYPES } from '@jetstream/shared/constants';
import { saveFile } from '@jetstream/shared/ui-utils';
import { AsyncJob, ErrorResult, RecordResult } from '@jetstream/types';
import { unparse } from 'papaparse';

export function downloadJob(job: AsyncJob) {
switch (job.type) {
Expand All @@ -17,7 +17,7 @@ export function downloadJob(job: AsyncJob) {
fields: '',
};
} else {
const errors = (result as ErrorResult).errors;
const errors = (result as ErrorResult)?.errors || [];
return {
id: '',
success: false,
Expand Down

0 comments on commit 21650bc

Please sign in to comment.