From 40c118df5541746fa871bacce4da92047a29edf3 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 c0c9332660..25e802f8b4 100644 --- a/common/src/app/common/schema.cljc +++ b/common/src/app/common/schema.cljc @@ -686,8 +686,8 @@ pred) pred (if (some? max) (fn [v] - (and (>= max v) - (pred v))) + (and (pred v) + (>= max v))) pred)] {:pred pred @@ -724,8 +724,8 @@ pred) pred (if (some? max) (fn [v] - (and (>= max v) - (pred v))) + (and (pred v) + (>= max v))) pred)] {:pred pred @@ -754,8 +754,8 @@ pred) pred (if (some? max) (fn [v] - (and (>= max v) - (pred v))) + (and (pred v) + (>= max v))) pred) gen (sg/one-of