org-agenda: Do not break TODO list view with empty tasks

* lisp/org-agenda.el (org-agenda-get-todos): Prevent an error when
  encountering tasks with only the TODO keyword.
This commit is contained in:
Nicolas Goaziou 2011-11-14 00:36:23 +01:00
parent 9edb523bdd
commit 57caa09106
1 changed files with 2 additions and 1 deletions

View File

@ -4626,7 +4626,8 @@ the documentation of `org-diary'."
(setq marker (org-agenda-new-marker (match-beginning 0))
category (org-get-category)
org-category-pos (get-text-property (point) 'org-category-position)
txt (buffer-substring (match-beginning 2) (match-end 3))
txt (buffer-substring
(org-trim (match-beginning 2) (match-end 0)))
tags (org-get-tags-at (point))
txt (org-agenda-format-item "" txt category tags)
priority (1+ (org-get-priority txt))