Permalink
Browse files

Still throw exceptions on nil keys

  • Loading branch information...
1 parent 42d1feb commit e01ae71ba95a4628fd3776b9eb7891e2bf1bcd51 @stuartsierra stuartsierra committed Sep 14, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/main/clojure/clojure/data/json_new.clj
@@ -22,9 +22,11 @@
(defn- default-write-key-fn
[x]
- (if (instance? clojure.lang.Named x)
- (name x)
- (str x)))
+ (cond (instance? clojure.lang.Named x)
+ (name x)
+ (nil? x)
+ (throw (Exception. "JSON object properties may not be nil"))
+ :else (str x)))
(defn- default-value-fn [k v] v)

0 comments on commit e01ae71

Please sign in to comment.