diff --git a/frontend/src/app/main/ui/hooks.cljs b/frontend/src/app/main/ui/hooks.cljs index a7ba644c8c..b4ad8fe616 100644 --- a/frontend/src/app/main/ui/hooks.cljs +++ b/frontend/src/app/main/ui/hooks.cljs @@ -214,10 +214,11 @@ (mf/use-effect deps (fn [] - (let [sub (->> stream (rx/subs! on-subscribe))] - #(do - (rx/dispose! sub) - (when on-dispose (on-dispose)))))))) + (when stream + (let [sub (->> stream (rx/subs! on-subscribe))] + #(do + (rx/dispose! sub) + (when on-dispose (on-dispose))))))))) ;; https://reactjs.org/docs/hooks-faq.html#how-to-get-the-previous-props-or-state ;; FIXME: replace with rumext