Skip to content

Commit

Permalink
Make _onSchemaChange robust against not having aceEditor loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
josdejong committed Jun 13, 2022
1 parent f6105e4 commit 07239a7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/js/textmode.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 07239a7

Please sign in to comment.