AUDIT: r17152 - gnucash/trunk/src/tax/us - Bug #528835: Harden gnc:txf-get-code-info when tax lookups fail.

Andreas Köhler andi5 at cvs.gnucash.org
Sun May 11 17:41:02 EDT 2008


Author: andi5
Date: 2008-05-11 17:41:01 -0400 (Sun, 11 May 2008)
New Revision: 17152
Trac: http://svn.gnucash.org/trac/changeset/17152

Modified:
   gnucash/trunk/src/tax/us/txf-de_DE.scm
   gnucash/trunk/src/tax/us/txf.scm
Log:
Bug #528835: Harden gnc:txf-get-code-info when tax lookups fail.

BP


Modified: gnucash/trunk/src/tax/us/txf-de_DE.scm
===================================================================
--- gnucash/trunk/src/tax/us/txf-de_DE.scm	2008-05-11 17:31:24 UTC (rev 17151)
+++ gnucash/trunk/src/tax/us/txf-de_DE.scm	2008-05-11 21:41:01 UTC (rev 17152)
@@ -39,7 +39,9 @@
 ;;;; Private
 
 (define (gnc:txf-get-code-info categories code index)
-  (vector-ref (cdr (assv code categories)) index))
+  (let ((category (assv code categories)))
+    (and category
+         (vector-ref (cdr category) index))))
 
 (define txf-help-categories
   (list

Modified: gnucash/trunk/src/tax/us/txf.scm
===================================================================
--- gnucash/trunk/src/tax/us/txf.scm	2008-05-11 17:31:24 UTC (rev 17151)
+++ gnucash/trunk/src/tax/us/txf.scm	2008-05-11 21:41:01 UTC (rev 17152)
@@ -30,7 +30,9 @@
 ;;;; Private
 
 (define (gnc:txf-get-code-info categories code index)
-  (vector-ref (cdr (assv code categories)) index))
+  (let ((category (assv code categories)))
+    (and category
+         (vector-ref (cdr category) index))))
 
 (define txf-help-categories
   (list



More information about the gnucash-changes mailing list