Merge pull request #10 from jpett/patch-1

Fix error Cannot read property 'getModeId' of null
This commit is contained in:
Alexandru Dima 2020-12-02 22:58:19 +01:00 committed by GitHub
commit ae46dfbebd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -103,7 +103,7 @@ export class DiagnosticsAdapter {
.then((diagnostics) => {
const markers = diagnostics.map((d) => toDiagnostics(resource, d));
let model = editor.getModel(resource);
if (model.getModeId() === languageId) {
if (model && model.getModeId() === languageId) {
editor.setModelMarkers(model, languageId, markers);
}
})