From 7ffb6c472c840acf8df5a3dd652d1c111787f87f Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sun, 10 Aug 2008 02:53:56 -0400 Subject: The balance report is working again. --- src/account.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/account.cc') diff --git a/src/account.cc b/src/account.cc index 6c1f81a0..f613d983 100644 --- a/src/account.cc +++ b/src/account.cc @@ -219,8 +219,13 @@ void account_t::calculate_sums() (*pair.second).calculate_sums(); xdata_t& child_xd((*pair.second).xdata()); - add_or_set_value(xd.total, child_xd.total); - xd.total_count += child_xd.total_count + child_xd.count; + if (! child_xd.total.is_null()) { + add_or_set_value(xd.total, child_xd.total); + xd.total_count += child_xd.total_count + child_xd.count; + } else { + assert(child_xd.total_count == 0); + assert(child_xd.count == 0); + } } call_scope_t args(*this); -- cgit v1.2.3