mirror of
https://github.com/penpot/penpot.git
synced 2025-01-21 06:02:32 -05:00
🐛 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.
This commit is contained in:
parent
b160ba1793
commit
946dac3c9f
1 changed files with 6 additions and 6 deletions
|
@ -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]
|
||||
|
|
Loading…
Add table
Reference in a new issue