diff --git a/src/jsonWorker.ts b/src/jsonWorker.ts index f826609b..bce6ff27 100644 --- a/src/jsonWorker.ts +++ b/src/jsonWorker.ts @@ -63,8 +63,11 @@ export class JSONWorker { doValidation(uri: string): Thenable { let document = this._getTextDocument(uri); - let jsonDocument = this._languageService.parseJSONDocument(document); - return this._languageService.doValidation(document, jsonDocument); + if (document) { + let jsonDocument = this._languageService.parseJSONDocument(document); + return this._languageService.doValidation(document, jsonDocument); + } + return Promise.as([]); } doComplete(uri: string, position: ls.Position): Thenable { let document = this._getTextDocument(uri);