r21424 - gnucash/branches/2.4/src/engine - [21423] Bug #626970 - Crash when saving a transaction whose destination account
Geert Janssens
gjanssens at code.gnucash.org
Sun Oct 16 17:31:16 EDT 2011
Author: gjanssens
Date: 2011-10-16 17:31:16 -0400 (Sun, 16 Oct 2011)
New Revision: 21424
Trac: http://svn.gnucash.org/trac/changeset/21424
Modified:
gnucash/branches/2.4/src/engine/Split.c
Log:
[21423] Bug #626970 - Crash when saving a transaction whose destination account
was deleted in the meantime
Modified: gnucash/branches/2.4/src/engine/Split.c
===================================================================
--- gnucash/branches/2.4/src/engine/Split.c 2011-10-16 21:01:28 UTC (rev 21423)
+++ gnucash/branches/2.4/src/engine/Split.c 2011-10-16 21:31:16 UTC (rev 21424)
@@ -721,14 +721,18 @@
void
xaccSplitCommitEdit(Split *s)
{
- Account *acc, *orig_acc;
+ Account *acc = NULL;
+ Account *orig_acc = NULL;
g_return_if_fail(s);
if (!qof_instance_is_dirty(QOF_INSTANCE(s)))
return;
orig_acc = s->orig_acc;
- acc = s->acc;
+
+ if (GNC_IS_ACCOUNT(s->acc))
+ acc=s->acc;
+
/* Remove from lot (but only if it hasn't been moved to
new lot already) */
if (s->lot && (gnc_lot_get_account(s->lot) != acc || qof_instance_get_destroying(s)))
More information about the gnucash-changes
mailing list