Exceptions when trying to remove a registered JSON schema and disposing a model. Fixes Microsoft/monaco-editor#1254

This commit is contained in:
Martin Aeschlimann 2019-03-18 13:03:06 +01:00
parent d9372e4944
commit 40c2b11e24
2 changed files with 2 additions and 2 deletions

View file

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