technomancy / leiningen

Moved to Codeberg; this is a convenience mirror
https://codeberg.org/leiningen/leiningen
Other
7.29k stars 1.61k forks source link

Make `utils/mkdirs` nil-safe #2778

Closed vemv closed 2 years ago

vemv commented 2 years ago

Part of https://github.com/technomancy/leiningen/issues/2777

If for whatever reason (utils/mkdirs nil) was invoked, one would get java.lang.Exception: Couldn't create directories: which is not a very informative error.

I'd propose to make this defn's API akin to io/file's - which returns nil on nil inputs instead of throwing.

Unfortunately I'm not able to reproduce the bug that is causing these issues in the first place, namely https://github.com/clojure-emacs/cider/issues/3108. So I can't debug why (utils/mkdirs nil) was being invoked to begin with.

technomancy commented 2 years ago

Oops; haha, I guess I should read all the messages before replying.

Looks good; thanks.