mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
[date-utilities] avoid report crash if start>end date
This commit is contained in:
parent
9642025745
commit
b7a3652de7
@ -339,6 +339,11 @@
|
||||
(assv-ref MonthDeltas incr))
|
||||
(define (make-interval from to)
|
||||
(list from (if (< to enddate) (decdate to SecDelta) enddate)))
|
||||
(when (< enddate startdate)
|
||||
(let ((saved-enddate enddate))
|
||||
(gnc:warn "start > end date. Swapping dates to avoid some reports crashing.")
|
||||
(set! enddate startdate)
|
||||
(set! startdate saved-enddate)))
|
||||
(let loop ((result '())
|
||||
(date startdate)
|
||||
(idx 0))
|
||||
@ -365,6 +370,11 @@
|
||||
(define (gnc:make-date-list startdate enddate incr)
|
||||
(define month-delta
|
||||
(assv-ref MonthDeltas incr))
|
||||
(when (< enddate startdate)
|
||||
(let ((saved-enddate enddate))
|
||||
(gnc:warn "start > end date. Swapping dates to avoid some reports crashing.")
|
||||
(set! enddate startdate)
|
||||
(set! startdate saved-enddate)))
|
||||
(let loop ((result '())
|
||||
(date startdate)
|
||||
(idx 0))
|
||||
|
Loading…
Reference in New Issue
Block a user