Protect against a case where xact->entry may legitimately be NULL.

This commit is contained in:
John Wiegley 2008-07-17 20:09:28 -04:00
parent 5f472969cd
commit 595452e332

View file

@ -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);