summaryrefslogtreecommitdiff
path: root/journal.cc
diff options
context:
space:
mode:
Diffstat (limited to 'journal.cc')
-rw-r--r--journal.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/journal.cc b/journal.cc
index 5922cd34..30d258f1 100644
--- a/journal.cc
+++ b/journal.cc
@@ -139,8 +139,12 @@ account_t * account_t::find_account(const std::string& name,
if (i == accounts.end()) {
if (! auto_create)
return NULL;
+
account = new account_t(this, first);
- accounts.insert(accounts_pair(first, account));
+
+ std::pair<accounts_map::iterator, bool> result
+ = accounts.insert(accounts_pair(first, account));
+ assert(result.second);
} else {
account = (*i).second;
}