Details
-
Type:
Defect
-
Status:
Closed
-
Resolution: Declined
-
Affects Version/s: None
-
Fix Version/s: Backlog
-
Component/s: None
-
Labels:None
Description
Version: Clojure 1.2 / clojure-contrib 1.2
This call:
user=> (clojure.contrib.string/replace-str "a" "b" nil)
#<CompilerException java.lang.NullPointerException (NO_SOURCE_FILE:29)>
throws a NullPointerException when passed a nil string. It seems like more corner cases could be automatically handled by returning nil in this case rather than throwing an NPE. At the very least, it would be nice to update the docstring to state that s cannot be nil.
Converted from http://www.assembla.com/spaces/clojure/tickets/345