Browse Source

fix(graph-parser): avoid parsing illegal id

Andelf 3 years ago
parent
commit
333017235b
1 changed files with 2 additions and 1 deletions
  1. 2 1
      deps/graph-parser/src/logseq/graph_parser/block.cljc

+ 2 - 1
deps/graph-parser/src/logseq/graph_parser/block.cljc

@@ -431,7 +431,8 @@
   (or (when-let [custom-id (or (get-in properties [:properties :custom-id])
                                (get-in properties [:properties :custom_id])
                                (get-in properties [:properties :id]))]
-        (let [custom-id (and (string? custom-id) (string/trim custom-id))]
+        ;; guard against non-string custom-ids
+        (when-let [custom-id (and (string? custom-id) (string/trim custom-id))]
           (some-> custom-id parse-uuid)))
       (d/squuid)))