From 1dcefc65701ab872eb9e490bc66ac5865e97f095 Mon Sep 17 00:00:00 2001 From: Yi JiHong <0125ses@hanmail.net> Date: Sun, 24 Mar 2024 23:09:23 +0900 Subject: [PATCH] Fix: exception handling - _setCharCount #1286 --- src/lib/core.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/core.js b/src/lib/core.js index 3023d0b6..9b2923b6 100755 --- a/src/lib/core.js +++ b/src/lib/core.js @@ -5785,7 +5785,11 @@ export default function (context, pluginCallButtons, plugins, lang, options, _re */ _setCharCount: function () { if (context.element.charCounter) { - _w.setTimeout(function () { context.element.charCounter.textContent = functions.getCharCount(options.charCounterType); }); + _w.setTimeout(function (functions, options) { + if (this.textContent && functions) { + this.textContent = functions.getCharCount(options.charCounterType); + } + }.bind(context.element.charCounter, functions, options), 0); } },