mirror of
https://github.com/penpot/penpot.git
synced 2026-05-11 11:03:52 +00: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
@ -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…
x
Reference in New Issue
Block a user