From: Matt S Trout Date: Tue, 23 Oct 2012 19:54:18 +0000 (+0000) Subject: default updated to epoch time if no entries X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7386f21dc8e7d37b5dff6114c874b0ae5148d7ce;p=scpubgit%2FApp-SCS.git default updated to epoch time if no entries --- diff --git a/lib/App/SCS/Plugin/Feeds/Generator.pm b/lib/App/SCS/Plugin/Feeds/Generator.pm index 9e9f959..f498561 100644 --- a/lib/App/SCS/Plugin/Feeds/Generator.pm +++ b/lib/App/SCS/Plugin/Feeds/Generator.pm @@ -37,6 +37,8 @@ sub _config_to_data { my @entry_pages = $base_page->children(%{$config->{entries}}) ->latest(10)->flatten; my $updated = (sort map $_->created, @entry_pages)[-1]; + # in case of no entries yet + $updated ||= '1970-01-01 00:00:00'; my $base = $self->mounted_at; +{ %$config,