From a6b1ac9cf0f8c89af06b945a532634f76edd7242 Mon Sep 17 00:00:00 2001 From: Bryce Covert Date: Thu, 1 Aug 2019 06:38:58 -0700 Subject: [PATCH] don't freak out over nulls. --- src/clj/auto_ap/graphql/ledger.clj | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/clj/auto_ap/graphql/ledger.clj b/src/clj/auto_ap/graphql/ledger.clj index 91614864..4ed26a13 100644 --- a/src/clj/auto_ap/graphql/ledger.clj +++ b/src/clj/auto_ap/graphql/ledger.clj @@ -177,8 +177,8 @@ (mapv (fn [li ] (-> li - (update :debit #(Double/parseDouble %)) - (update :credit #(Double/parseDouble %)))) + (update :debit #(Double/parseDouble (if (str/blank? %) "0" %))) + (update :credit #(Double/parseDouble (if (str/blank? %) "0" %))))) lis))))] (let [vendor (all-vendors (:vendor_name entry))] (when-not (all-clients (:client_code entry)) @@ -236,3 +236,4 @@ :existing [] :errors (map (fn [x] {:external_id (:external_id x) :error (:error x)}) errors)})) +