From b46de2cd570d1e4bfa9042fcfcdccca69635bda2 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Wed, 4 Jan 2017 13:03:25 +0100 Subject: [PATCH] Do not clear ranges if editor model is not tehre --- src/vs/workbench/common/editor/rangeDecorations.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/common/editor/rangeDecorations.ts b/src/vs/workbench/common/editor/rangeDecorations.ts index cecec707c43..62c1ccd9ec1 100644 --- a/src/vs/workbench/common/editor/rangeDecorations.ts +++ b/src/vs/workbench/common/editor/rangeDecorations.ts @@ -96,8 +96,10 @@ export class RangeHighlightDecorations implements IDisposable { } public dispose() { - this.removeHighlightRange(); - this.disposeEditorListeners(); - this.editor = null; + if (this.editor && this.editor.getModel()) { + this.removeHighlightRange(); + this.disposeEditorListeners(); + this.editor = null; + } } } \ No newline at end of file