From 75011ca0ffb05bfbac2a0489eee90dd68ca830d5 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 28 Oct 2024 13:51:40 +0100 Subject: [PATCH] :bug: Fix incorrect pred composition on number schema types Fixes the following: => (sm/validate (sm/schema [::sm/int {:max 10}]) nil) Cannot invoke "Object.getClass()" because "x" is null --- common/src/app/common/schema.cljc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/common/src/app/common/schema.cljc b/common/src/app/common/schema.cljc index 8acd34beb1..5ffd035f63 100644 --- a/common/src/app/common/schema.cljc +++ b/common/src/app/common/schema.cljc @@ -694,8 +694,8 @@ pred) pred (if (some? max) (fn [v] - (and (>= max v) - (pred v))) + (and (pred v) + (>= max v))) pred)] {:pred pred @@ -732,8 +732,8 @@ pred) pred (if (some? max) (fn [v] - (and (>= max v) - (pred v))) + (and (pred v) + (>= max v))) pred)] {:pred pred @@ -762,8 +762,8 @@ pred) pred (if (some? max) (fn [v] - (and (>= max v) - (pred v))) + (and (pred v) + (>= max v))) pred) gen (sg/one-of