From 450cdb2b6df565a7a7d0b572d38de3f11859b1d1 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Thu, 14 Aug 2008 02:39:43 -0400 Subject: [PATCH] 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. --- src/entry.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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