From 27ba9545bd5f924f9caec255289c5c959a59c978 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sun, 5 Feb 2023 15:55:15 -0800 Subject: When a post has no date at all, default to the current date --- src/post.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/post.cc b/src/post.cc index 4f3ed48a..72930b46 100644 --- a/src/post.cc +++ b/src/post.cc @@ -106,8 +106,10 @@ date_t post_t::primary_date() const return xdata_->date; if (! _date) { - assert(xact); - return xact->date(); + if (xact) + return xact->date(); + else + return CURRENT_DATE(); } return *_date; } -- cgit v1.2.3