From bb719097021d7403b905627bb7dc4c500046c655 Mon Sep 17 00:00:00 2001 From: jpinkney Date: Mon, 20 Nov 2017 13:43:05 -0500 Subject: [PATCH] Fix for #18 --- src/languageService/services/yamlHover.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/languageService/services/yamlHover.ts b/src/languageService/services/yamlHover.ts index 49fc8650..87cae733 100644 --- a/src/languageService/services/yamlHover.ts +++ b/src/languageService/services/yamlHover.ts @@ -30,6 +30,9 @@ export class YAMLHover { let offset = document.offsetAt(position); let currentDoc = matchOffsetToDocument(offset, doc); + if(currentDoc === null){ + return null; + } let node = currentDoc.getNodeFromOffset(offset); if (!node || (node.type === 'object' || node.type === 'array') && offset > node.start + 1 && offset < node.end - 1) { return this.promise.resolve(void 0);