fix(code): guard nil editor dom obj

This commit is contained in:
Andelf
2023-09-25 11:28:56 +08:00
parent 87b2680b95
commit 438976c7e6

View File

@@ -485,7 +485,7 @@
(when-not (:file? (first (:rum/args state)))
(let [code (nth (:rum/args state) 3)
editor @(:editor-atom state)]
(when (not= (.getValue editor) code)
(when (and editor (not= (.getValue editor) code))
(.setValue editor code))))
state)}
[state _config id attr code _theme _options]