r15934 - gnucash/trunk/src/backend/file - Replace silent failures with noisy assertions.

David Hampton hampton at cvs.gnucash.org
Thu Apr 19 00:18:19 EDT 2007


Author: hampton
Date: 2007-04-19 00:18:19 -0400 (Thu, 19 Apr 2007)
New Revision: 15934
Trac: http://svn.gnucash.org/trac/changeset/15934

Modified:
   gnucash/trunk/src/backend/file/gnc-account-xml-v2.c
   gnucash/trunk/src/backend/file/gnc-transaction-xml-v2.c
Log:
Replace silent failures with noisy assertions.


Modified: gnucash/trunk/src/backend/file/gnc-account-xml-v2.c
===================================================================
--- gnucash/trunk/src/backend/file/gnc-account-xml-v2.c	2007-04-19 04:16:39 UTC (rev 15933)
+++ gnucash/trunk/src/backend/file/gnc-account-xml-v2.c	2007-04-19 04:18:19 UTC (rev 15934)
@@ -188,6 +188,8 @@
     GUID *guid;
 
     guid = dom_tree_to_guid(node);
+    g_return_val_if_fail(guid, FALSE);
+
     xaccAccountSetGUID(pdata->account, guid);
 
     g_free(guid);

Modified: gnucash/trunk/src/backend/file/gnc-transaction-xml-v2.c
===================================================================
--- gnucash/trunk/src/backend/file/gnc-transaction-xml-v2.c	2007-04-19 04:16:39 UTC (rev 15933)
+++ gnucash/trunk/src/backend/file/gnc-transaction-xml-v2.c	2007-04-19 04:18:19 UTC (rev 15934)
@@ -307,7 +307,7 @@
     GUID *id = dom_tree_to_guid(node);
     Account *account;
 
-    if (!id) return FALSE;
+    g_return_val_if_fail(id, FALSE);
 
     account = xaccAccountLookup (id, pdata->book);
     if (!account && gnc_transaction_xml_v2_testing &&
@@ -333,7 +333,7 @@
     GUID *id = dom_tree_to_guid(node);
     GNCLot *lot;
 
-    if (!id) return FALSE;
+    g_return_val_if_fail(id, FALSE);
 
     lot = gnc_lot_lookup (id, pdata->book);
     if (!lot && gnc_transaction_xml_v2_testing &&



More information about the gnucash-changes mailing list