Use fallback date when there are no visible articles
This fixes a crash
This commit is contained in:
parent
0e7aa0451f
commit
7bcc91a2fa
|
@ -34,7 +34,7 @@ body {
|
||||||
background-color: var(--colour-bg);
|
background-color: var(--colour-bg);
|
||||||
margin: 0;
|
margin: 0;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 2em 200px max-content min-content;
|
grid-template-columns: 2em 200px 600px min-content;
|
||||||
grid-column-gap: 2em;
|
grid-column-gap: 2em;
|
||||||
grid-template-rows: 2em min-content min-content 1fr;
|
grid-template-rows: 2em min-content min-content 1fr;
|
||||||
grid-template-areas:
|
grid-template-areas:
|
||||||
|
|
|
@ -152,7 +152,9 @@ public:
|
||||||
void getPostFeed(HTTPServerRequest req, HTTPServerResponse res) {
|
void getPostFeed(HTTPServerRequest req, HTTPServerResponse res) {
|
||||||
Article[] articleList = articles.sortedList;
|
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
|
string response = q"EOS
|
||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
|
Loading…
Reference in a new issue