fix: report error if the title property is not a text

related to https://sentry.io/organizations/logseq/issues/3638204936
pull/7178/head
Tienson Qin 2022-11-02 00:33:57 +08:00
parent 3375bb0674
commit a2322ecffb
1 changed files with 7 additions and 5 deletions

View File

@ -376,11 +376,13 @@
;; sanitized page name changed
(when-let [title (get-in block' [:block/properties :title])]
(if (string? title)
(when-let [old-page-name (:block/name (db/entity (:db/id (:block/page block'))))]
(when (and (:block/pre-block? block')
(not (string/blank? title))
(not= (util/page-name-sanity-lc title) old-page-name))
(state/pub-event! [:page/title-property-changed old-page-name title]))))))))
(state/pub-event! [:page/title-property-changed old-page-name title])))
(js/console.error (str "Title is not a string: " title))))))))
(defn save-block-if-changed!
([block value]