diff options
author | John Wiegley <johnw@newartisans.com> | 2008-08-14 02:39:43 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-08-14 02:39:43 -0400 |
commit | 450cdb2b6df565a7a7d0b572d38de3f11859b1d1 (patch) | |
tree | 9fe199fb3430a4f7a11687458d2bfe16c3fdf7cc /src/entry.cc | |
parent | 7a6d416f3b15b61d7d1c2859cd22f2c1b6c613c3 (diff) | |
download | ledger-450cdb2b6df565a7a7d0b572d38de3f11859b1d1.tar.gz ledger-450cdb2b6df565a7a7d0b572d38de3f11859b1d1.tar.bz2 ledger-450cdb2b6df565a7a7d0b572d38de3f11859b1d1.zip |
If a transaction's entry has no journal pointer (and this can happen with
temporaries), reference session_t::current to get at the current report
pointer.
Diffstat (limited to 'src/entry.cc')
-rw-r--r-- | src/entry.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/entry.cc b/src/entry.cc index 97bc90f1..7cb4b926 100644 --- a/src/entry.cc +++ b/src/entry.cc @@ -401,7 +401,13 @@ expr_t::ptr_op_t entry_t::lookup(const string& name) return WRAP_FUNCTOR(get_wrapper<&get_payee>); break; } - return journal->owner->current_report->lookup(name); + + if (journal) { + assert(journal->owner == session_t::current); + return journal->owner->current_report->lookup(name); + } else { + return session_t::current->current_report->lookup(name); + } } bool entry_t::valid() const |