diff --git a/frontend/src/lib/components/runs/BatchReRunOptionsPane.svelte b/frontend/src/lib/components/runs/BatchReRunOptionsPane.svelte index 182389d3c2..a635089caf 100644 --- a/frontend/src/lib/components/runs/BatchReRunOptionsPane.svelte +++ b/frontend/src/lib/components/runs/BatchReRunOptionsPane.svelte @@ -108,7 +108,7 @@ group.schemas.find((s) => s.script_hash === jobSchema.script_hash) ?? group.schemas[ group.schemas.push({ - schema: jobSchema.schema as Schema, + schema: (jobSchema.schema as Schema) ?? {}, job_ids: [], script_hash: jobSchema.script_hash }) - 1 @@ -130,7 +130,7 @@ } function propertyAlwaysExists(propertyName: string, group: JobGroup): boolean { for (const s of group.schemas) { - if (!(propertyName in (s.schema as Schema).properties)) return false + if (!(propertyName in ((s.schema as Schema)?.properties ?? {}))) return false } return true } @@ -138,7 +138,7 @@ function propertyAlwaysHasSameType(propertyName: string, group: JobGroup): boolean { let prevType = 'INIT' for (const s of group.schemas) { - const currType = (s.schema as Schema).properties[propertyName]?.type + const currType = (s.schema as Schema)?.properties?.[propertyName]?.type if (currType === undefined) continue if (prevType !== 'INIT' && currType !== prevType) return false prevType = currType @@ -159,7 +159,7 @@