From b160ba1793012cc581f61e0a84c965e4602976d2 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 6 Nov 2024 09:14:47 +0100 Subject: [PATCH 1/2] :paperclip: Update .gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index b0b2074d8d..ad4be629b8 100644 --- a/.gitignore +++ b/.gitignore @@ -74,3 +74,5 @@ node_modules /playwright-report/ /blob-report/ /playwright/.cache/ +/render-wasm/target/ +/**/.yarn/* From 946dac3c9f1327371997a1d8351a14836f4824fa Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 6 Nov 2024 09:15:06 +0100 Subject: [PATCH 2/2] :bug: Fix NPE on number schemas Mainly, without this fix, happens the following: user=> (sm/validate [::sm/int {:min 0}] nil) Execution error (NullPointerException) at app.common.schema/fn$fn (schema.cljc:692). Cannot invoke "Object.getClass()" because "x" is null And it should return `false` without an exception. --- 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 25e802f8b4..54d8e1910c 100644 --- a/common/src/app/common/schema.cljc +++ b/common/src/app/common/schema.cljc @@ -681,8 +681,8 @@ (let [pred int? pred (if (some? min) (fn [v] - (and (>= v min) - (pred v))) + (and (pred v) + (>= v min))) pred) pred (if (some? max) (fn [v] @@ -719,8 +719,8 @@ (let [pred double? pred (if (some? min) (fn [v] - (and (>= v min) - (pred v))) + (and (pred v) + (>= v min))) pred) pred (if (some? max) (fn [v] @@ -749,8 +749,8 @@ (let [pred number? pred (if (some? min) (fn [v] - (and (>= v min) - (pred v))) + (and (pred v) + (>= v min))) pred) pred (if (some? max) (fn [v]