0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-09-29 20:37:51 +00:00

agenda: Fix `org-get-time-of-day' on empty string

* lisp/org-agenda.el (org-get-time-of-day): Ensure S is not empty
before calling `get-text-property'.

This regression was introduced in aba1f2066.

Reported-by: Ihor Radchenko <yantar92@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2021-06/msg00385.html>

Reported-by: Ihor Radchenko <yantar92@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2021-06/msg00385.html>
This commit is contained in:
Nicolas Goaziou 2021-06-20 18:07:01 +02:00
parent 15badb32b7
commit c09356548f

View file

@ -6914,8 +6914,8 @@ where H:MM is the duration above midnight."
(group-n 3 (or "am" "pm")))
word-end)))
(save-match-data
(when (and (not (eq 'org-link (get-text-property 1 'face s)))
(string-match time-regexp s))
(when (and (string-match time-regexp s)
(not (eq 'org-link (get-text-property 1 'face s))))
(let ((hours
(let* ((ampm (and (match-end 3) (downcase (match-string 3 s))))
(am-p (equal ampm "am")))