Bug 765846 - Expense Over Time for subaccounts: An error occurred while running the report

fix crash if acc-depth too low
pull/294/head
Christopher Lam 8 years ago
parent 18f0d053b0
commit 51e2511223

@ -264,15 +264,25 @@ developing over time"))
(define (show-acct? a)
(member a accounts))
(define tree-depth (if (equal? account-levels 'all)
(gnc:get-current-account-tree-depth)
account-levels))
(define the-acount-destination-alist
(account-destination-alist accounts account-types tree-depth))
;;(gnc:debug accounts)
(if (not (null? accounts))
(if (null? the-acount-destination-alist)
(gnc:html-document-add-object!
document
(gnc:html-make-empty-data-warning
report-title (gnc:report-id report-obj)))
;; Define more helper variables.
(let* ((commodity-list #f)
(exchange-fn #f)
(tree-depth (if (equal? account-levels 'all)
(gnc:get-current-account-tree-depth)
account-levels))
(averaging-fraction-func (gnc:date-get-fraction-func averaging-selection))
(interval-fraction-func (gnc:date-get-fraction-func interval))
(averaging-multiplier
@ -368,10 +378,7 @@ developing over time"))
(define (apply-sign account x)
(if (reverse-balance? account) (- x) x))
(define (calculate-report accounts progress-range)
(let* ((the-acount-destination-alist (account-destination-alist accounts
account-types
tree-depth))
(account-reformat
(let* ((account-reformat
(if do-intervals?
(lambda (account result)
(map (lambda (collector datepair)
@ -644,7 +651,7 @@ developing over time"))
(gnc:html-document-add-object!
document
(gnc:html-make-empty-data-warning
report-title (gnc:report-id report-obj)))))
report-title (gnc:report-id report-obj))))))
;; else if no accounts selected
(gnc:html-document-add-object!

Loading…
Cancel
Save