From 4eabbb8e6ab498be90d6c8933e0af23e985568de Mon Sep 17 00:00:00 2001 From: rcmerci Date: Sat, 20 Jul 2024 23:53:27 +0800 Subject: [PATCH] fix: find-datom on empty-db --- src/datascript/db.cljc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/datascript/db.cljc b/src/datascript/db.cljc index 5b93a98f..fc5e2cae 100644 --- a/src/datascript/db.cljc +++ b/src/datascript/db.cljc @@ -1149,7 +1149,7 @@ cmp #?(:clj (.comparator ^clojure.lang.Sorted set) :cljs (.-comparator set)) from (components->pattern db index c0 c1 c2 c3 e0 tx0) to (components->pattern db index c0 c1 c2 c3 emax txmax) - datom (first (set/seek (seq set) from))] + datom (when-let [set* (seq set)] (first (set/seek set* from)))] (when (and (some? datom) (<= 0 (cmp to datom))) datom)))