gnucash maint: [commodity-utils] partially revert eac79bd506395120

Christopher Lam clam at code.gnucash.org
Tue May 7 08:38:42 EDT 2019


Updated	 via  https://github.com/Gnucash/gnucash/commit/48c3c8bc (commit)
	from  https://github.com/Gnucash/gnucash/commit/810d283e (commit)



commit 48c3c8bc511f181f5de90ea079ec20d5c6dd2a0e
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Tue May 7 20:34:55 2019 +0800

    [commodity-utils] partially revert eac79bd506395120
    
    The eac79bd506395120 commit was slightly overzealous - if pair was #f,
    originally this make-exchange-function would create a function that
    returns (gnc:make-gnc-monetary domestic 0); I thought it was
    acceptable to return #f instead but this would lead to report
    crash. Revert previous behaviour.

diff --git a/gnucash/report/report-system/commodity-utilities.scm b/gnucash/report/report-system/commodity-utilities.scm
index a0877a1c5..65c203259 100644
--- a/gnucash/report/report-system/commodity-utilities.scm
+++ b/gnucash/report/report-system/commodity-utilities.scm
@@ -698,10 +698,11 @@ construct with gnc:make-gnc-monetary and gnc:monetary->string instead.")
              (gnc:exchange-if-same foreign domestic)
              (let* ((foreign-comm (gnc:gnc-monetary-commodity foreign))
                     (pair (assoc foreign-comm exchange-alist)))
-               (and pair
-                    (gnc:make-gnc-monetary
-                     domestic
-                     (* (gnc:gnc-monetary-amount foreign) (cadr pair)))))))))
+               (gnc:make-gnc-monetary
+                domestic
+                (if pair
+                    (* (gnc:gnc-monetary-amount foreign) (cadr pair))
+                    0)))))))
 
 ;; Helper for the gnc:exchange-by-pricalist* below. Exchange the
 ;; <gnc:monetary> 'foreign' into the <gnc:commodity*> 'domestic' by



Summary of changes:
 gnucash/report/report-system/commodity-utilities.scm | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)



More information about the gnucash-changes mailing list