Skip to content

Commit

Permalink
[commodity-utils] partially revert eac79bd
Browse files Browse the repository at this point in the history
The eac79bd 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.
  • Loading branch information
christopherlam committed May 7, 2019
1 parent 810d283 commit 48c3c8b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions gnucash/report/report-system/commodity-utilities.scm
Expand Up @@ -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
Expand Down

1 comment on commit 48c3c8b

@christopherlam
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note typo -- the offending commit was 375013f rather than eac79bd.

Please sign in to comment.