Browse Source

fix: block search intermittently failing hard in file graph

Gabriel Horner 1 year ago
parent
commit
3aa489f82d
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/main/frontend/components/editor.cljs

+ 2 - 1
src/main/frontend/components/editor.cljs

@@ -292,7 +292,8 @@
                  state)}
                  state)}
   [state _edit-block input id q format selected-text]
   [state _edit-block input id q format selected-text]
   (let [result (->> (rum/react (get state ::result))
   (let [result (->> (rum/react (get state ::result))
-                    (remove (fn [b] (string/blank? (:block/title (db-model/query-block-by-uuid (:block/uuid b)))))))
+                    (remove (fn [b] (or (nil? (:block/uuid b))
+                                        (string/blank? (:block/title (db-model/query-block-by-uuid (:block/uuid b))))))))
         db? (config/db-based-graph? (state/get-current-repo))
         db? (config/db-based-graph? (state/get-current-repo))
         embed? (and db? (= @commands/*current-command "Block embed"))
         embed? (and db? (= @commands/*current-command "Block embed"))
         chosen-handler (block-on-chosen-handler embed? input id q format selected-text)
         chosen-handler (block-on-chosen-handler embed? input id q format selected-text)