From e547f5d4d9e8f95cf302b4e050f954631d94c328 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 23 Dec 2019 11:32:26 +0100 Subject: Fix invalid logic in reccurence generation. --- module/vcomponent/recurrence/generate.scm | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'module/vcomponent/recurrence/generate.scm') diff --git a/module/vcomponent/recurrence/generate.scm b/module/vcomponent/recurrence/generate.scm index 0ad30c84..081c250f 100644 --- a/module/vcomponent/recurrence/generate.scm +++ b/module/vcomponent/recurrence/generate.scm @@ -90,16 +90,15 @@ ((e _) (let ((expected-start (attr e 'DTSTART))) ;; If we have alternatives, check them - (cond [(attr e 'X-HNH-ALTERNATIVES) - (lambda (alternatives) - ;; A recurrence id matching the expected time means that - ;; we have an actuall alternative/exception, use that - ;; instead of the regular event. - (find (lambda (alt) (time=? expected-start (attr alt 'RECURRENCE-ID))) - alternatives)) - => identity] - ;; If we did't have an exception just return the regular event. - [else e])))) + (or (and=> (attr e 'X-HNH-ALTERNATIVES) + (lambda (alternatives) + ;; A recurrence id matching the expected time means that + ;; we have an actuall alternative/exception, use that + ;; instead of the regular event. + (find (lambda (alt) (time=? expected-start (attr alt 'RECURRENCE-ID))) + alternatives))) + ;; If we did't have an exception just return the regular event. + e)))) ;; Event x Rule → Bool (continue?) (match-lambda -- cgit v1.2.3