Skip to content

Commit 430cfd4

Browse files
authored
[Fix #3763] Do not call cider-docstring fns unless we have a doc (#3764)
Sometimes, there is no "doc" attribute in the nrepl-dict. In such cases, `fetched-doc` is nil, which causes `cider-docstring--*` functions to error. We should only call these functions when we have a docstring to render.
1 parent 588c579 commit 430cfd4

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## master (unreleased)
44

5+
### Bugs fixed
6+
7+
- [#3763](https://github.com/clojure-emacs/cider/issues/3763): Fix `cider-docview-render` completion popup error when symbol being completed does not have a docstring.
8+
59
## 1.16.1 (2024-12-03)
610

711
### Changes

cider-doc.el

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -428,10 +428,11 @@ in a COMPACT format is specified, FOR-TOOLTIP if specified."
428428
"doc-first-sentence-fragments" (nrepl-dict-get info "doc-first-sentence-fragments"))))
429429
(fetched-doc (nrepl-dict-get info "doc"))
430430
(doc (or rendered-fragments
431-
(if compact
432-
(cider-docstring--trim
433-
(cider-docstring--format fetched-doc))
434-
fetched-doc)
431+
(when fetched-doc
432+
(if compact
433+
(cider-docstring--trim
434+
(cider-docstring--format fetched-doc))
435+
fetched-doc))
435436
(unless compact
436437
"Not documented.")))
437438
(url (nrepl-dict-get info "url"))

0 commit comments

Comments
 (0)