fix: page uuid might be empty

pull/9248/head
Tienson Qin 2023-04-26 12:25:49 +08:00
parent 5493479a0e
commit b7bc230ed8
1 changed files with 10 additions and 9 deletions

View File

@ -317,8 +317,9 @@
:page-content
(let [{:block/keys [snippet uuid]} data ;; content here is normalized
repo (state/sub :git/current-repo)
page (model/query-block-by-uuid uuid) ;; it's actually a page
page (when uuid (model/query-block-by-uuid uuid)) ;; it's actually a page
format (db/get-page-format page)]
(when page
[:span {:data-block-ref uuid}
(search-result-item {:name "page"
:title (t :search-item/page)
@ -326,7 +327,7 @@
(if page
(page-content-search-result-item repo uuid format snippet search-q search-mode)
(do (log/error "search result with non-existing uuid: " data)
(str "Cache is outdated. Please click the 'Re-index' button in the graph's dropdown menu."))))])
(str "Cache is outdated. Please click the 'Re-index' button in the graph's dropdown menu."))))]))
nil)]))