r17280 - gnucash/branches/2.2/src/app-utils - [r17256] Bug #531662: Harden budget->guid to grok #f input instead of crashing.

Christian Stimming cstim at cvs.gnucash.org
Mon Jul 7 16:57:08 EDT 2008


Author: cstim
Date: 2008-07-07 16:57:08 -0400 (Mon, 07 Jul 2008)
New Revision: 17280
Trac: http://svn.gnucash.org/trac/changeset/17280

Modified:
   gnucash/branches/2.2/src/app-utils/options.scm
Log:
[r17256] Bug #531662: Harden budget->guid to grok #f input instead of crashing.

Originally committed by andi5.


Modified: gnucash/branches/2.2/src/app-utils/options.scm
===================================================================
--- gnucash/branches/2.2/src/app-utils/options.scm	2008-07-07 20:56:59 UTC (rev 17279)
+++ gnucash/branches/2.2/src/app-utils/options.scm	2008-07-07 20:57:08 UTC (rev 17280)
@@ -312,9 +312,9 @@
          documentation-string)
 
   (define (budget->guid budget)
-    (if (string? budget)
-        budget
-        (gncBudgetGetGUID budget)))
+    (cond ((eq? budget #f) #f)
+          ((string? budget) budget)
+          (t (gncBudgetGetGUID budget))))
 
   (define (guid->budget budget)
     (if (string? budget)



More information about the gnucash-changes mailing list