TypeError: Cannot read property 'getText' of null. Fixes Microsoft/monaco-editor#354

pull/2748/head
Martin Aeschlimann 2017-06-26 15:16:03 +08:00
parent 1a124f5415
commit a3fe14998f
1 changed files with 6 additions and 3 deletions

View File

@ -43,9 +43,12 @@ export class CSSWorker {
doValidation(uri: string): Promise<ls.Diagnostic[]> {
let document = this._getTextDocument(uri);
let stylesheet = this._languageService.parseStylesheet(document);
let diagnostics = this._languageService.doValidation(document, stylesheet);
return Promise.as(diagnostics)
if (document) {
let stylesheet = this._languageService.parseStylesheet(document);
let diagnostics = this._languageService.doValidation(document, stylesheet);
return Promise.as(diagnostics)
}
return Promise.as([]);
}
doComplete(uri: string, position: ls.Position): Promise<ls.CompletionList> {
let document = this._getTextDocument(uri);