Add nil guard to PG JSON example

This commit is contained in:
Sean Corfield 2020-09-15 22:46:35 -07:00
parent c736a63382
commit 84fe3ea1af

View file

@ -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)))
```