summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/account.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/account.cc b/src/account.cc
index 40ddf70b..e1874839 100644
--- a/src/account.cc
+++ b/src/account.cc
@@ -137,7 +137,10 @@ void account_t::add_post(post_t * post)
bool account_t::remove_post(post_t * post)
{
- assert(! posts.empty());
+ // It's possible that 'post' wasn't yet in this account, but try to
+ // remove it anyway. This can happen if there is an error during
+ // parsing, when the posting knows what it's account is, but
+ // xact_t::finalize has not yet added that posting to the account.
posts.remove(post);
post->account = NULL;
return true;