summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2023-02-05 15:55:15 -0800
committerJohn Wiegley <johnw@newartisans.com>2023-02-06 15:58:46 -0800
commit27ba9545bd5f924f9caec255289c5c959a59c978 (patch)
tree65bf6d3de3230dabf6bf43ca83b460aa63b4f3dd /src
parentf519fe4cf0982b0d4c79dbf8e10f4f17ec2f6786 (diff)
downloadfork-ledger-27ba9545bd5f924f9caec255289c5c959a59c978.tar.gz
fork-ledger-27ba9545bd5f924f9caec255289c5c959a59c978.tar.bz2
fork-ledger-27ba9545bd5f924f9caec255289c5c959a59c978.zip
When a post has no date at all, default to the current date
Diffstat (limited to 'src')
-rw-r--r--src/post.cc6
1 files changed, 4 insertions, 2 deletions
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;
}