summaryrefslogtreecommitdiff
path: root/src/xact.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-01-19 22:23:27 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-01-19 22:23:27 -0400
commit091144e5e83557b3940719b256ef63f6b54d099a (patch)
treef71a3725e81306e540e8ae5e7847f3512e44f182 /src/xact.cc
parentadf8cfbbc077c9b7d33dcdfea1ca119904f85a8e (diff)
downloadfork-ledger-091144e5e83557b3940719b256ef63f6b54d099a.tar.gz
fork-ledger-091144e5e83557b3940719b256ef63f6b54d099a.tar.bz2
fork-ledger-091144e5e83557b3940719b256ef63f6b54d099a.zip
Don't look for an xact's state in its entry if there isn't one.
Diffstat (limited to 'src/xact.cc')
-rw-r--r--src/xact.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/xact.cc b/src/xact.cc
index 66c08f5b..7f441b49 100644
--- a/src/xact.cc
+++ b/src/xact.cc
@@ -54,10 +54,12 @@ optional<date_t> xact_t::effective_date() const
item_t::state_t xact_t::state() const
{
- state_t entry_state = entry->state();
- if ((_state == UNCLEARED && entry_state != UNCLEARED) ||
- (_state == PENDING && entry_state == CLEARED))
- return entry_state;
+ if (entry) {
+ state_t entry_state = entry->state();
+ if ((_state == UNCLEARED && entry_state != UNCLEARED) ||
+ (_state == PENDING && entry_state == CLEARED))
+ return entry_state;
+ }
return _state;
}