r17167 - gnucash/branches/2.2/src/tax/us - [r17152] Bug #528835: Harden gnc:txf-get-code-info when tax lookups fail.

Christian Stimming cstim at cvs.gnucash.org
Wed May 21 16:16:19 EDT 2008


Author: cstim
Date: 2008-05-21 16:16:19 -0400 (Wed, 21 May 2008)
New Revision: 17167
Trac: http://svn.gnucash.org/trac/changeset/17167

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

Committed by andi5.


Modified: gnucash/branches/2.2/src/tax/us/txf-de_DE.scm
===================================================================
--- gnucash/branches/2.2/src/tax/us/txf-de_DE.scm	2008-05-21 20:16:10 UTC (rev 17166)
+++ gnucash/branches/2.2/src/tax/us/txf-de_DE.scm	2008-05-21 20:16:19 UTC (rev 17167)
@@ -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/branches/2.2/src/tax/us/txf.scm
===================================================================
--- gnucash/branches/2.2/src/tax/us/txf.scm	2008-05-21 20:16:10 UTC (rev 17166)
+++ gnucash/branches/2.2/src/tax/us/txf.scm	2008-05-21 20:16:19 UTC (rev 17167)
@@ -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