From 84fe3ea1af57c3aa26d13c7f04b2ebebc0ee27a4 Mon Sep 17 00:00:00 2001 From: Sean Corfield Date: Tue, 15 Sep 2020 22:46:35 -0700 Subject: [PATCH] Add nil guard to PG JSON example --- doc/tips-and-tricks.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/tips-and-tricks.md b/doc/tips-and-tricks.md index e4f391b..cb55b55 100644 --- a/doc/tips-and-tricks.md +++ b/doc/tips-and-tricks.md @@ -241,7 +241,8 @@ containing JSON: (let [type (.getType v) value (.getValue v)] (if (#{"jsonb" "json"} type) - (with-meta (<-json value) {:pgtype type}) + (when value + (with-meta (<-json value) {:pgtype type})) value))) ```