Skip to content

Commit e51ebbc

Browse files
alexander-yakushevbbatsov
authored andcommitted
[docstring] Don't crash if string doc is nil
1 parent be4b4ac commit e51ebbc

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Bugs fixed
66

77
- [#3742](https://github.com/clojure-emacs/cider/issues/3742): Restore syntax highlighting in result minibuffer.
8+
- [#3747](https://github.com/clojure-emacs/cider/issues/3747): Fix errors when docstring is nil.
89

910
## 1.16.0 (2024-09-24)
1011

cider-docstring.el

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,10 @@ Prioritize rendering as much as possible while staying within `cider-docstring-m
143143

144144
(cl-defun cider-docstring--trim (string &optional (max-lines cider-docstring-max-lines))
145145
"Return MAX-LINES of STRING, adding \"...\" if trimming was necessary."
146-
(let* ((lines (split-string string "\n"))
147-
(string (string-join (seq-take lines max-lines) "\n")))
148-
(concat string (when (> (length lines) max-lines) "..."))))
146+
(when string
147+
(let* ((lines (split-string string "\n"))
148+
(string (string-join (seq-take lines max-lines) "\n")))
149+
(concat string (when (> (length lines) max-lines) "...")))))
149150

150151
(defun cider-docstring--format (string)
151152
"Return a nicely formatted STRING to be displayed to the user.

0 commit comments

Comments
 (0)