fix: envinput crash on debounce handle editor undefined

This commit is contained in:
Andrew Bastin
2022-01-01 15:44:28 +05:30
parent 4770b86948
commit 314c0968b1

View File

@@ -120,9 +120,11 @@ export default defineComponent({
},
handleChange() {
this.debouncedHandler = debounce(function () {
if (this.internalValue !== this.$refs.editor.textContent) {
this.internalValue = this.$refs.editor.textContent
this.processHighlights()
if (this.$refs.editor) {
if (this.internalValue !== this.$refs.editor.textContent) {
this.internalValue = this.$refs.editor.textContent
this.processHighlights()
}
}
}, 5)
this.debouncedHandler()