Welcome! Please see the About page for a little more info on how this works.

0 votes
in Errors by

This one confused me when I'd accidentally passed a list (returned by a function) in to update-in instead of a vector.

Example:

`
some-app.core=> (update-in [:a :b :c] [1] name)
[:a "b" :c]
some-app.core=> (update-in '(:a :b :c) [1] name)

NullPointerException clojure.core/name (core.clj:1518)
`

Similar result if passing in another function; for example:

`
some-app.core=> (update-in ["a" "b" "c"] [1] str/capitalize)
["a" "B" "c"]
some-app.core=> (update-in '("a" "b" "c") [1] str/capitalize)

NullPointerException clojure.string/capitalize (string.clj:199)
`

2 Answers

0 votes
by

Comment made by: alexmiller

I think this is effectively a dupe of CLJ-1107 re throwing on get with a non-Associative collection?

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJ-1672 (reported by alex+import)
...