Skip to content

Commit

Permalink
guard against nils for AttributesCompilerExpr
Browse files Browse the repository at this point in the history
  • Loading branch information
onionpancakes committed Feb 20, 2024
1 parent e1c0a26 commit 2814251
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/dev/onionpancakes/chassis/compiler.clj
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@

(defn attrs-compiler-binding?
[^clojure.lang.Compiler$LocalBinding b]
(attrs-compiler-expr? (.-init b)))
(and (some? b)
(attrs-compiler-expr? (.-init b))))

(extend-protocol AttributesCompilerExpr
clojure.lang.Compiler$NilExpr
Expand All @@ -118,6 +119,8 @@
clojure.lang.Compiler$MapExpr
(attrs-compiler-expr? [this] true)
Object
(attrs-compiler-expr? [_] false)
nil
(attrs-compiler-expr? [_] false))

(extend-protocol CompilableForm
Expand Down

0 comments on commit 2814251

Please sign in to comment.