Guard against a possible null value

This commit is contained in:
John Wiegley 2013-09-20 00:54:21 -05:00
parent 8048581ac8
commit d30c3fb869

View file

@ -151,7 +151,7 @@ account_t * journal_t::register_account(const string& name, post_t * post,
// the payee indicates an account that should be used.
if (result->name == _("Unknown")) {
foreach (account_mapping_t& value, payees_for_unknown_accounts) {
if (value.first.match(post->xact->payee)) {
if (post && value.first.match(post->xact->payee)) {
result = value.second;
break;
}