Don't look for an xact's state in its entry if there isn't one.

This commit is contained in:
John Wiegley 2009-01-19 22:23:27 -04:00
parent adf8cfbbc0
commit 091144e5e8

View file

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