Skip to content

Commit f5f44fd

Browse files
committed
Fix error when nil is passed to inflection code.
1 parent a055eb3 commit f5f44fd

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

clj-refactor.el

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3359,13 +3359,14 @@ See: https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-create-fn-from-e
33593359
(cljr--insert-example-fn fn-name args path))))
33603360

33613361
(defun cljr--inflect-last-word (f s)
3362-
(save-match-data
3363-
(let* ((words (split-string s "-"))
3364-
(last-word (car (last words)))
3365-
(prefix (butlast words)))
3366-
(mapconcat 'identity
3367-
(append prefix (list (funcall f last-word)))
3368-
"-"))))
3362+
(when s
3363+
(save-match-data
3364+
(let* ((words (split-string s "-"))
3365+
(last-word (car (last words)))
3366+
(prefix (butlast words)))
3367+
(mapconcat 'identity
3368+
(append prefix (list (funcall f last-word)))
3369+
"-")))))
33693370

33703371
(defun cljr--create-fn-from-list-fold (args path)
33713372
(cljr--insert-example-fn (car args)

0 commit comments

Comments
 (0)