diff --git a/backend/src/api/controllers/result.ts b/backend/src/api/controllers/result.ts index 3d25a2642..87e62a07b 100644 --- a/backend/src/api/controllers/result.ts +++ b/backend/src/api/controllers/result.ts @@ -245,7 +245,10 @@ export async function addResult( throw new MonkeyError(400, "Impossible funbox combination"); } - if (completedEvent.keySpacing !== "toolong") { + if ( + completedEvent.keySpacing !== "toolong" && + completedEvent.keySpacing.length > 0 + ) { completedEvent.keySpacingStats = { average: completedEvent.keySpacing.reduce( @@ -255,7 +258,10 @@ export async function addResult( }; } - if (completedEvent.keyDuration !== "toolong") { + if ( + completedEvent.keyDuration !== "toolong" && + completedEvent.keyDuration.length > 0 + ) { completedEvent.keyDurationStats = { average: completedEvent.keyDuration.reduce(