Jelajahi Sumber

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>
Nicolas Goaziou 3 tahun lalu
induk
melakukan
c09356548f
1 mengubah file dengan 2 tambahan dan 2 penghapusan
  1. 2 2
      lisp/org-agenda.el

+ 2 - 2
lisp/org-agenda.el

@@ -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")))