Check if marker is valid before use
authorLeo <sdl.web@gmail.com>
Fri, 21 Oct 2011 00:56:31 +0000 (00:56 +0000)
committerCarsten Dominik <carsten.dominik@gmail.com>
Fri, 21 Oct 2011 08:09:40 +0000 (10:09 +0200)
* lisp/org-agenda.el (org-agenda-do-context-action): Check if marker
is valid before use.

lisp/org-agenda.el

index 3d89c63..cbe36af 100644 (file)
@@ -6784,13 +6784,13 @@ When called with a prefix argument, include all archive files as well."
 (defun org-agenda-do-context-action ()
   "Show outline path and, maybe, follow mode window."
   (let ((m (org-get-at-bol 'org-marker)))
-    (if (and org-agenda-follow-mode m)
-       (if org-agenda-follow-indirect
-           (org-agenda-tree-to-indirect-buffer)
-         (org-agenda-show)))
-    (if (and m org-agenda-show-outline-path)
-       (org-with-point-at m
-         (org-display-outline-path t)))))
+    (when (and (markerp m) (marker-buffer m))
+      (and org-agenda-follow-mode
+          (if org-agenda-follow-indirect
+              (org-agenda-tree-to-indirect-buffer)
+            (org-agenda-show)))
+      (and org-agenda-show-outline-path
+          (org-with-point-at m (org-display-outline-path t))))))
 
 (defun org-agenda-show-priority ()
   "Show the priority of the current item.