diff --git a/sequencing-server/src/lib/batchLoaders/simulatedActivityBatchLoader.ts b/sequencing-server/src/lib/batchLoaders/simulatedActivityBatchLoader.ts index 2c741f0fc0..0e0462ba3f 100644 --- a/sequencing-server/src/lib/batchLoaders/simulatedActivityBatchLoader.ts +++ b/sequencing-server/src/lib/batchLoaders/simulatedActivityBatchLoader.ts @@ -166,6 +166,13 @@ export const simulatedActivityInstanceBySimulatedActivityIdBatchLoader: BatchLoa ); } + if(spans.length > 1) { + return new ErrorWithStatusCode( + `Too many spans with simulated activity id ${simulatedActivityId} found for simulation_dataset with id ${simulationDatasetId}`, + 404, + ); + } + const span = spans[0]; const simulatedActivity: GraphQLSimulatedActivityInstance = { id: span.id,