From 996986c492d671e9e49eb3c527cf2d08faff0387 Mon Sep 17 00:00:00 2001 From: Sergey Zakharchenko Date: Thu, 22 Oct 2020 07:45:12 +0000 Subject: [PATCH] fix(clojure): handle literal null JSON body correctly jsToEdn() expects jsType(null) to return 'null', but null has no fields, so jsType(null) fails. Add a special case for null to jsType() to make things work as expected. --- src/targets/clojure/clj_http.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/targets/clojure/clj_http.js b/src/targets/clojure/clj_http.js index ec13d5364..39ac649af 100644 --- a/src/targets/clojure/clj_http.js +++ b/src/targets/clojure/clj_http.js @@ -30,7 +30,9 @@ File.prototype.toString = function () { var jsType = function (x) { return (typeof x !== 'undefined') - ? x.constructor.name.toLowerCase() + ? ((x !== null) + ? x.constructor.name.toLowerCase() + : 'null') : null }