Browse Source

fix: roam export

Tienson Qin 2 years ago
parent
commit
4708e6067d
1 changed files with 9 additions and 8 deletions
  1. 9 8
      src/main/frontend/external/roam_export.cljs

+ 9 - 8
src/main/frontend/external/roam_export.cljs

@@ -33,14 +33,15 @@
      (into {}))))
 
 (defn update-content [content uuid->uid-map]
-  (let [uuids (keys uuid->uid-map)]
-    (reduce
-     (fn [acc uuid]
-       (if (str/includes? acc (str uuid))
-         (str/replace acc (str uuid) (get uuid->uid-map uuid))
-         acc))
-     content
-     uuids)))
+  (when content                         ; page block doesn't have content
+    (let [uuids (keys uuid->uid-map)]
+     (reduce
+      (fn [acc uuid]
+        (if (str/includes? acc (str uuid))
+          (str/replace acc (str uuid) (get uuid->uid-map uuid))
+          acc))
+      content
+      uuids))))
 
 (defn update-uid [{:block/keys [uuid content] :as b}
                   uuid->uid-map]