From 1c0d0f2a85afe12bc25f57360912756ac151f1bc Mon Sep 17 00:00:00 2001 From: Andreas Rottmann Date: Fri, 3 Jul 2009 18:08:47 +0200 Subject: [PATCH] Don't crash generating the atom feed when there are no posts yet --- tekuti/page-helpers.scm | 4 +++- tekuti/page.scm | 10 ++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/tekuti/page-helpers.scm b/tekuti/page-helpers.scm index 709f44c..3a04d3f 100644 --- a/tekuti/page-helpers.scm +++ b/tekuti/page-helpers.scm @@ -278,7 +278,9 @@ (@ (xmlns "http://www.w3.org/2005/Atom") (xml:base ,(relurl ""))) (title (@ (type "text")) ,*title*) (subtitle (@ (type "text")) ,*subtitle*) - (updated ,(timestamp->atom-date last-modified)) + ,@(if last-modified + `((updated ,(timestamp->atom-date last-modified))) + '()) (generator (@ (uri "http://wingolog.org/software/tekuti") (version "what")) "tekuti") diff --git a/tekuti/page.scm b/tekuti/page.scm index c9fcf7c..f114715 100644 --- a/tekuti/page.scm +++ b/tekuti/page.scm @@ -314,10 +314,12 @@ 'status 304 'doctype #f)) (else - (rcons* (rpush 'output-headers (cons "Last-Modified" - (timestamp->rfc822-date - last-modified)) - request) + (rcons* (if last-modified + (rpush 'output-headers (cons "Last-Modified" + (timestamp->rfc822-date + last-modified)) + request) + request) 'doctype "" 'content-type "application/atom+xml" 'sxml (append (atom-header server-name last-modified)