r17796 - gnucash/trunk/src/backend/sql - Add check that account != NULL when inserting lot

Phil Longstaff plongstaff at cvs.gnucash.org
Sat Jan 3 22:14:46 EST 2009


Author: plongstaff
Date: 2009-01-03 22:14:46 -0500 (Sat, 03 Jan 2009)
New Revision: 17796
Trac: http://svn.gnucash.org/trac/changeset/17796

Modified:
   gnucash/trunk/src/backend/sql/gnc-lots-sql.c
Log:
Add check that account != NULL when inserting lot


Modified: gnucash/trunk/src/backend/sql/gnc-lots-sql.c
===================================================================
--- gnucash/trunk/src/backend/sql/gnc-lots-sql.c	2009-01-02 10:52:37 UTC (rev 17795)
+++ gnucash/trunk/src/backend/sql/gnc-lots-sql.c	2009-01-04 03:14:46 UTC (rev 17796)
@@ -84,7 +84,9 @@
 
     pBook = qof_instance_get_book( QOF_INSTANCE(lot) );
     pAccount = xaccAccountLookup( guid, pBook );
-    xaccAccountInsertLot( pAccount, lot );
+	if( pAccount != NULL ) {
+    	xaccAccountInsertLot( pAccount, lot );
+	}
 }
 
 static void



More information about the gnucash-changes mailing list