From 07239a7501c32f68358495816b6eb87f7f600eff Mon Sep 17 00:00:00 2001 From: Jos de Jong Date: Mon, 13 Jun 2022 11:10:37 +0200 Subject: [PATCH] Make `_onSchemaChange` robust against not having aceEditor loaded --- src/js/textmode.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/js/textmode.js b/src/js/textmode.js index 50b805ee5..339ad6907 100644 --- a/src/js/textmode.js +++ b/src/js/textmode.js @@ -406,6 +406,10 @@ textmode.create = function (container, options = {}) { } textmode._onSchemaChange = function (schema, schemaRefs) { + if (!this.aceEditor) { + return + } + if (this.options.allowSchemaSuggestions && schema) { this.aceEditor.setOption('enableBasicAutocompletion', [new SchemaTextCompleter(schema, schemaRefs)]) this.aceEditor.setOption('enableLiveAutocompletion', true)