summaryrefslogtreecommitdiff
path: root/journal.cc
diff options
context:
space:
mode:
Diffstat (limited to 'journal.cc')
-rw-r--r--journal.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/journal.cc b/journal.cc
index abe7e67c..05bc4b55 100644
--- a/journal.cc
+++ b/journal.cc
@@ -468,11 +468,17 @@ bool account_t::valid() const
for (accounts_map::const_iterator i = accounts.begin();
i != accounts.end();
- i++)
+ i++) {
+ if (this == (*i).second) {
+ DEBUG_PRINT("ledger.validate", "account_t: parent refers to itself!");
+ return false;
+ }
+
if (! (*i).second->valid()) {
DEBUG_PRINT("ledger.validate", "account_t: child not valid");
return false;
}
+ }
return true;
}