From 4b2cfb76302241349fa6e2f8391e6a758c5815c0 Mon Sep 17 00:00:00 2001 From: jorg-vr Date: Tue, 28 Nov 2023 15:54:23 +0100 Subject: [PATCH] Fix line of code not shown on invalid judge output --- app/assets/javascripts/components/annotations/line_of_code.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/components/annotations/line_of_code.ts b/app/assets/javascripts/components/annotations/line_of_code.ts index 5e1909fde8..1ca5b08d38 100644 --- a/app/assets/javascripts/components/annotations/line_of_code.ts +++ b/app/assets/javascripts/components/annotations/line_of_code.ts @@ -107,7 +107,7 @@ export class LineOfCode extends ShadowlessLitElement { mergeRanges(ranges: { start: number, length: number, index: number }[]): { start: number, length: number, indexes: number[] }[] { const annotationsByPosition: number[][] = new Array(this.codeLength).fill(null).map(() => []); for (const range of ranges) { - for (let i = range.start; i < range.start + range.length; i++) { + for (let i = range.start; i < range.start + range.length && i < this.codeLength; i++) { annotationsByPosition[i].push(range.index); } }