summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Lawrence <richard.lawrence@berkeley.edu>2013-04-20 08:58:29 +0200
committerBastien Guerry <bzg@altern.org>2013-04-20 08:58:29 +0200
commit1b0c4cf0f8bce4887884c3ecaf5b7532ec84d586 (patch)
tree728b478ea5d944f0b1ce483cab9da91fc3ee2167
parent2a192ff6c1708d183d4e9d038c074cca46e209c5 (diff)
downloadorg-mode-1b0c4cf0f8bce4887884c3ecaf5b7532ec84d586.tar.gz
org-agenda.el (org-cmp-ts): Avoid error when trying to string-match against nil
* org-agenda.el (org-cmp-ts): Avoid error when trying to string-match against nil. TINYCHANGE
-rw-r--r--lisp/org-agenda.el12
1 files changed, 6 insertions, 6 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 631c6d0..754247a 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -6984,14 +6984,14 @@ The optional argument TYPE tells the agenda type."
(defsubst org-cmp-ts (a b &optional type)
"Compare the timestamps values of entries A and B.
-When TYPE is \"scheduled\", \"deadline\", \"timestamp\"
-or \"timestamp_ia\", compare within each of these type.
-When TYPE is the empty string, compare all timestamps
-without respect of their type."
+When TYPE is \"scheduled\", \"deadline\", \"timestamp\" or
+\"timestamp_ia\", compare within each of these type. When TYPE
+is the empty string, compare all timestamps without respect of
+their type."
(let* ((def (if org-sort-agenda-notime-is-late 9901 -1))
- (ta (or (and (string-match type (get-text-property 1 'type a))
+ (ta (or (and (string-match type (or (get-text-property 1 'type a) ""))
(get-text-property 1 'ts-date a)) def))
- (tb (or (and (string-match type (get-text-property 1 'type b))
+ (tb (or (and (string-match type (or (get-text-property 1 'type b) ""))
(get-text-property 1 'ts-date b)) def)))
(cond ((< ta tb) -1)
((< tb ta) +1))))