r16724 - gnucash/trunk/src/business/business-reports - Fix a crash in the receivable aging report (#384879)
Derek Atkins
warlord at cvs.gnucash.org
Tue Dec 25 20:38:45 EST 2007
Author: warlord
Date: 2007-12-25 20:38:45 -0500 (Tue, 25 Dec 2007)
New Revision: 16724
Trac: http://svn.gnucash.org/trac/changeset/16724
Modified:
gnucash/trunk/src/business/business-reports/aging.scm
Log:
Fix a crash in the receivable aging report (#384879)
Dont access the owner object after it's freed.
Modified: gnucash/trunk/src/business/business-reports/aging.scm
===================================================================
--- gnucash/trunk/src/business/business-reports/aging.scm 2007-12-26 01:07:04 UTC (rev 16723)
+++ gnucash/trunk/src/business/business-reports/aging.scm 2007-12-26 01:38:45 UTC (rev 16724)
@@ -196,20 +196,27 @@
;; if it's an existing company, destroy the temp owner and
;; then make sure the currencies match
(begin
- (gncOwnerDestroy temp-owner)
(if (not (gnc-commodity-equiv
this-currency
(company-get-currency company-info)))
- (cons #f (sprintf
- (_ "Transactions relating to '%s' contain \
-more than one currency. This report is not designed to cope with this possibility.") (gncOwnerGetName owner)))
+ (let ((error-str
+ (string-append "IGNORING TRANSACTION!\n" "Invoice Owner: " (gncOwnerGetName owner)
+ "\nTransaction GUID:" (gncTransGetGuid transaction)
+ "\nTransaction Currency" (gnc-commodity-get-mnemonic this-currency)
+ "\nClient Currency" (gnc-ommodity-get-mnemonic(company-get-currency company-info)))))
+ (gnc-error-dialog '() error-str)
+ (gnc:error error-str)
+ (cons #f (sprintf
+ (_ "Transactions relating to '%s' contain \
++more than one currency. This report is not designed to cope with this possibility.") (gncOwnerGetName owner))))
(begin
(gnc:debug "it's an old company")
(if (gnc-numeric-negative-p value)
(process-invoice company-info (gnc-numeric-neg value) bucket-intervals this-date)
(process-payment company-info value))
(hash-set! hash guid company-info)
- (cons #t guid))))
+ (cons #t guid)))
+ (gncOwnerDestroy temp-owner))
;; if it's a new company
(begin
More information about the gnucash-changes
mailing list