diff options
author | John Wiegley <johnw@newartisans.com> | 2023-02-05 15:55:15 -0800 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2023-02-06 15:58:46 -0800 |
commit | 27ba9545bd5f924f9caec255289c5c959a59c978 (patch) | |
tree | 65bf6d3de3230dabf6bf43ca83b460aa63b4f3dd /src | |
parent | f519fe4cf0982b0d4c79dbf8e10f4f17ec2f6786 (diff) | |
download | fork-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.cc | 6 |
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; } |