summaryrefslogtreecommitdiff
path: root/textual.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2008-07-17 20:09:28 -0400
committerJohn Wiegley <johnw@newartisans.com>2008-07-17 20:55:15 -0400
commit595452e332f338c27a3d7befb75f1b39e5a4f9a7 (patch)
tree6faeae4b02922880af3c954ed9c173db9e8447de /textual.cc
parent5f472969cdc10e5b41f0f66502b2310ca39577b3 (diff)
downloadledger-595452e332f338c27a3d7befb75f1b39e5a4f9a7.tar.gz
ledger-595452e332f338c27a3d7befb75f1b39e5a4f9a7.tar.bz2
ledger-595452e332f338c27a3d7befb75f1b39e5a4f9a7.zip
Protect against a case where xact->entry may legitimately be NULL.
Diffstat (limited to 'textual.cc')
-rw-r--r--textual.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/textual.cc b/textual.cc
index 61cf37f8..b80c820c 100644
--- a/textual.cc
+++ b/textual.cc
@@ -261,8 +261,8 @@ transaction_t * parse_transaction(char * line, account_t * account,
if (xact->amount.commodity() &&
! xact->amount.commodity().annotated)
xact->amount.annotate_commodity(per_unit_cost,
- xact->entry->actual_date(),
- xact->entry->code);
+ xact->entry ? xact->entry->actual_date() : datetime_t(),
+ xact->entry ? xact->entry->code : "");
DEBUG_PRINT("ledger.textual.parse", "line " << linenum << ": " <<
"Total cost is " << *xact->cost);