From 314c0968b146b8195991f0e357a000c71359bedc Mon Sep 17 00:00:00 2001 From: Andrew Bastin Date: Sat, 1 Jan 2022 15:44:28 +0530 Subject: [PATCH] fix: envinput crash on debounce handle editor undefined --- packages/hoppscotch-app/components/smart/EnvInput.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/hoppscotch-app/components/smart/EnvInput.vue b/packages/hoppscotch-app/components/smart/EnvInput.vue index a922c6ba6..3668fd9f4 100644 --- a/packages/hoppscotch-app/components/smart/EnvInput.vue +++ b/packages/hoppscotch-app/components/smart/EnvInput.vue @@ -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()