Use fallback date when there are no visible articles
This fixes a crash
This commit is contained in:
parent
0e7aa0451f
commit
7bcc91a2fa
2 changed files with 4 additions and 2 deletions
|
|
@ -152,7 +152,9 @@ public:
|
|||
void getPostFeed(HTTPServerRequest req, HTTPServerResponse res) {
|
||||
Article[] articleList = articles.sortedList;
|
||||
|
||||
DateTime lastUpdated = articleList.map!"a.firstPublished()".maxElement;
|
||||
DateTime lastUpdated = articleList.length > 0
|
||||
? articleList.map!"a.firstPublished()".maxElement
|
||||
: DateTime(2019, 06, 30);
|
||||
|
||||
string response = q"EOS
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue