Browse Source

org-agenda: Nicer error message when accessing killed buffer

* lisp/org-agenda.el (org-agenda-switch-to): Throw an error if marker
  points to no buffer.
Nicolas Richard 2 years ago
parent
commit
f8731eaeec
1 changed files with 1 additions and 0 deletions
  1. 1 0
      lisp/org-agenda.el

+ 1 - 0
lisp/org-agenda.el

@@ -8583,6 +8583,7 @@ It also looks at the text of the entry itself."
 		       (org-agenda-error)))
 	   (buffer (marker-buffer marker))
 	   (pos (marker-position marker)))
+      (unless buffer (user-error "Trying to switch to non-existent buffer"))
       (org-pop-to-buffer-same-window buffer)
       (and delete-other-windows (delete-other-windows))
       (widen)