r16361 - gnucash/trunk - Don't crash running the Account/Account Txn Reports from A/R (#460432)

Derek Atkins warlord at cvs.gnucash.org
Thu Jul 26 15:15:44 EDT 2007


Author: warlord
Date: 2007-07-26 15:15:43 -0400 (Thu, 26 Jul 2007)
New Revision: 16361
Trac: http://svn.gnucash.org/trac/changeset/16361

Modified:
   gnucash/trunk/
   gnucash/trunk/src/business/business-reports/owner-report.scm
   gnucash/trunk/src/report/standard-reports/standard-reports.scm
Log:
Don't crash running the Account/Account Txn Reports from A/R (#460432)
Two fixes here:

* make sure to call the correct report.  The C code calls into scheme
  with a #f, not '(), so check for both cases in standard-reports.scm.

* In the owner-report, don't return #f or '() but rather return -1
  when the user tries to run the Account Transaction Report on A/R or
  A/P when they don't have a transaction selected.  This will at least
  stop gnucash from crashing, but it will appear that gnucash isn't
  doing anything.  A step in the right direction but still not the
  best solution.




Property changes on: gnucash/trunk
___________________________________________________________________
Name: svk:merge
   - 3889ce50-311e-0410-a464-f059747ec5d1:/local/gnucash/branches/swig-redo:802
3889ce50-311e-0410-a464-f059747ec5d1:/local/gnucash/trunk:1037
57a11ea4-9604-0410-9ed3-97b8803252fd:/gnucash/branches/gobject-engine-dev-warlord:15827
d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/branches/gobject-engine-dev-warlord:14369
d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/branches/gobject-engine-dev-warlord1:14446
d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/trunk:14601
d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/trunk2:14896
   + 3889ce50-311e-0410-a464-f059747ec5d1:/local/gnucash/branches/swig-redo:802
3889ce50-311e-0410-a464-f059747ec5d1:/local/gnucash/trunk:1037
57a11ea4-9604-0410-9ed3-97b8803252fd:/gnucash/branches/gobject-engine-dev-warlord:15827
d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/branches/gobject-engine-dev-warlord:14369
d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/branches/gobject-engine-dev-warlord1:14446
d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/trunk:14601
d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/trunk2:14996

Modified: gnucash/trunk/src/business/business-reports/owner-report.scm
===================================================================
--- gnucash/trunk/src/business/business-reports/owner-report.scm	2007-07-26 14:25:16 UTC (rev 16360)
+++ gnucash/trunk/src/business/business-reports/owner-report.scm	2007-07-26 19:15:43 UTC (rev 16361)
@@ -719,7 +719,7 @@
 
   (let* ((temp-owner (gncOwnerCreate))
 	 (owner (gnc:owner-from-split split temp-owner))
-	 (res #f))
+	 (res -1)) ;; XXX -- in this case we should create an error report
 
     (if (not (null? owner))
 	(set! res (gnc:owner-report-create owner account)))

Modified: gnucash/trunk/src/report/standard-reports/standard-reports.scm
===================================================================
--- gnucash/trunk/src/report/standard-reports/standard-reports.scm	2007-07-26 14:25:16 UTC (rev 16360)
+++ gnucash/trunk/src/report/standard-reports/standard-reports.scm	2007-07-26 19:15:43 UTC (rev 16361)
@@ -60,7 +60,7 @@
     (gnc:debug "hash: " gnc:*register-report-hash*)
     (gnc:debug "split: " split)
     (if type-info
-	(if (not (null? split))
+	(if (and split (not (null? split)))
 	    (begin (gnc:debug "get-split...") (get-split type-info))
 	    (begin (gnc:debug "get-non-split...") (get-non-split type-info)))
 	#f)))



More information about the gnucash-changes mailing list