Bug #626970 - Crash when saving a transaction whose destination account

was deleted in the meantime
Improved fix
BP

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21423 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Geert Janssens 2011-10-16 21:01:28 +00:00
parent 14c60deb29
commit 500882caf4

View File

@ -721,17 +721,17 @@ static void commit_err (QofInstance *inst, QofBackendError errcode)
void void
xaccSplitCommitEdit(Split *s) xaccSplitCommitEdit(Split *s)
{ {
Account *acc, *orig_acc; Account *acc = NULL;
Account *orig_acc = NULL;
g_return_if_fail(s); g_return_if_fail(s);
if (!qof_instance_is_dirty(QOF_INSTANCE(s))) if (!qof_instance_is_dirty(QOF_INSTANCE(s)))
return; return;
orig_acc = s->orig_acc; orig_acc = s->orig_acc;
acc = s->acc;
if (!GNC_IS_ACCOUNT(acc)) if (GNC_IS_ACCOUNT(s->acc))
return; acc=s->acc;
/* Remove from lot (but only if it hasn't been moved to /* Remove from lot (but only if it hasn't been moved to
new lot already) */ new lot already) */