Skip to content

Commit 4eabbb8

Browse files
committed
fix: find-datom on empty-db
1 parent 6b7d1eb commit 4eabbb8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/datascript/db.cljc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1149,7 +1149,7 @@
11491149
cmp #?(:clj (.comparator ^clojure.lang.Sorted set) :cljs (.-comparator set))
11501150
from (components->pattern db index c0 c1 c2 c3 e0 tx0)
11511151
to (components->pattern db index c0 c1 c2 c3 emax txmax)
1152-
datom (first (set/seek (seq set) from))]
1152+
datom (when-let [set* (seq set)] (first (set/seek set* from)))]
11531153
(when (and (some? datom) (<= 0 (cmp to datom)))
11541154
datom)))
11551155

0 commit comments

Comments
 (0)