[budget] fixcrash: fix crasher for some periods

eg. the following combo would previously crash:
- periods from next to current
- use accumulated amounts
This commit is contained in:
Christopher Lam 2019-10-03 00:52:17 +08:00
parent 5d15fd41fd
commit f015a96833

View File

@ -332,7 +332,7 @@
(let* ((comm (xaccAccountGetCommodity acct))
(reverse-balance? (gnc-reverse-balance acct))
(allperiods (filter number? (gnc:list-flatten column-list)))
(total-periods (if accumulate?
(total-periods (if (and accumulate? (not (null? allperiods)))
(iota (1+ (apply max allperiods)))
allperiods))
(income-acct? (eqv? (xaccAccountGetType acct) ACCT-TYPE-INCOME)))