From 472ede044204c03e390797841c1e76cb89b710c8 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Wed, 11 Apr 2018 13:47:41 +0200 Subject: [PATCH] Fixes Microsoft/monaco-editor#772: Avoid NPE --- src/vs/editor/contrib/suggest/suggestWidget.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vs/editor/contrib/suggest/suggestWidget.ts b/src/vs/editor/contrib/suggest/suggestWidget.ts index cf433d3dc8a..de265df494f 100644 --- a/src/vs/editor/contrib/suggest/suggestWidget.ts +++ b/src/vs/editor/contrib/suggest/suggestWidget.ts @@ -176,7 +176,9 @@ class Renderer implements IRenderer { } disposeTemplate(templateData: ISuggestionTemplateData): void { - templateData.highlightedLabel.dispose(); + if (templateData.highlightedLabel) { + templateData.highlightedLabel.dispose(); + } templateData.disposables = dispose(templateData.disposables); } }