소스 검색

fix(code): guard nil editor dom obj

Andelf 2 년 전
부모
커밋
438976c7e6
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/main/frontend/extensions/code.cljs

+ 1 - 1
src/main/frontend/extensions/code.cljs

@@ -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]