diff --git a/sequencing-server/src/lib/batchLoaders/simulatedActivityBatchLoader.ts b/sequencing-server/src/lib/batchLoaders/simulatedActivityBatchLoader.ts index e5915ec8ec..78c4cc800c 100644 --- a/sequencing-server/src/lib/batchLoaders/simulatedActivityBatchLoader.ts +++ b/sequencing-server/src/lib/batchLoaders/simulatedActivityBatchLoader.ts @@ -246,9 +246,10 @@ function convertType(value: any, schema: Schema): any { case SchemaTypes.String: return value; case SchemaTypes.Series: - return value.map((value: any) => convertType(value, schema.items)); + return value == null ? null : value.map((value: any) => convertType(value, schema.items)); case SchemaTypes.Struct: const struct: { [attributeName: string]: any } = {}; + if (value == null) {return null;} for (const [attributeKey, attributeSchema] of Object.entries(schema.items)) { struct[attributeKey] = convertType(value[attributeKey], attributeSchema); }