summaryrefslogtreecommitdiff
path: root/src/xact.cc
diff options
context:
space:
mode:
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;
}