diff --git a/static/line-colouring.ts b/static/line-colouring.ts index ecda68ed8..047624644 100644 --- a/static/line-colouring.ts +++ b/static/line-colouring.ts @@ -112,10 +112,18 @@ export class LineColouring { } public getColoursForCompiler(compilerId: number): Object { - return this.linesAndColourByCompiler[compilerId]; + if (this.linesAndColourByCompiler[compilerId]) { + return this.linesAndColourByCompiler[compilerId]; + } else { + return {}; + } } public getColoursForEditor(editorId: number): Object { - return this.linesAndColourByEditor[editorId]; + if (this.linesAndColourByEditor[editorId]) { + return this.linesAndColourByEditor[editorId]; + } else { + return {}; + } } };