Add `if' condition on (org-find-exact-headline-in-buffer query) return nil.

This commit is contained in:
stardiviner 2022-12-21 12:31:08 +08:00
parent b7d176dcfb
commit bb4032eb12

View file

@ -1318,8 +1318,9 @@ Each element has the form (NAME . (FILE . POSITION))."
;; jump to exact contact headline directly
(t
(with-current-buffer buf
(let ((position (org-find-exact-headline-in-buffer query)))
(goto-char (marker-position position))))
(if-let ((position (org-find-exact-headline-in-buffer query)))
(goto-char (marker-position position))
(user-error "[org-contacts] Can't find <%s> in your `org-contacts-files'." query)))
(display-buffer buf '(display-buffer-below-selected))
;; FIXME: