From f015a96833825df852f3e20bb5ce0ebcb78a8de4 Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Thu, 3 Oct 2019 00:52:17 +0800 Subject: [PATCH] [budget] fixcrash: fix crasher for some periods eg. the following combo would previously crash: - periods from next to current - use accumulated amounts --- gnucash/report/standard-reports/budget.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnucash/report/standard-reports/budget.scm b/gnucash/report/standard-reports/budget.scm index 71104db108..b5c1c6443e 100644 --- a/gnucash/report/standard-reports/budget.scm +++ b/gnucash/report/standard-reports/budget.scm @@ -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)))