From 30bcdda90e175f283f55709b937c7bd9d2e27e9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Moya?= Date: Thu, 19 May 2022 09:49:28 +0200 Subject: [PATCH] :bug: Add a protection for some corner cases --- common/src/app/common/geom/shapes.cljc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/src/app/common/geom/shapes.cljc b/common/src/app/common/geom/shapes.cljc index ac645e920..c9b919ba2 100644 --- a/common/src/app/common/geom/shapes.cljc +++ b/common/src/app/common/geom/shapes.cljc @@ -113,7 +113,9 @@ (close-attrs? attr val1 val2 mth/float-equal-precision)) ([attr val1 val2 precision] - (let [close-val? (fn [num1 num2] (< (mth/abs (- num1 num2)) precision))] + (let [close-val? (fn [num1 num2] + (when (and (number? num1) (number? num2)) + (< (mth/abs (- num1 num2)) precision)))] (cond (and (number? val1) (number? val2)) (close-val? val1 val2)