Просмотр исходного кода

fix(electron): avoid notifying destroyed window

Andelf 4 лет назад
Родитель
Сommit
a393d9f933
1 измененных файлов с 4 добавлено и 3 удалено
  1. 4 3
      src/electron/electron/fs_watcher.cljs

+ 4 - 3
src/electron/electron/fs_watcher.cljs

@@ -16,9 +16,10 @@
 
 (defonce file-watcher-chan "file-watcher")
 (defn send-file-watcher! [^js win type payload]
-  (.. win -webContents
-      (send file-watcher-chan
-            (bean/->js {:type type :payload payload}))))
+  (when-not (.isDestroyed win)
+    (.. win -webContents
+        (send file-watcher-chan
+              (bean/->js {:type type :payload payload})))))
 
 (defn- publish-file-event!
   [win dir path event]