mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Fix bug -- don't access NULL pointer.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6265 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -77,17 +77,18 @@ gnc_book_insert_trans (GNCBook *book, Transaction *trans)
|
||||
{
|
||||
PERR ("near-fatal: twin account not found");
|
||||
}
|
||||
|
||||
/* force to null, so remove doesn't occur */
|
||||
xaccSplitSetAccount (s, NULL);
|
||||
xaccAccountInsertSplit (twin, s);
|
||||
twin->balance_dirty = TRUE;
|
||||
twin->sort_dirty = TRUE;
|
||||
else
|
||||
{
|
||||
/* force to null, so remove doesn't occur */
|
||||
xaccSplitSetAccount (s, NULL);
|
||||
xaccAccountInsertSplit (twin, s);
|
||||
twin->balance_dirty = TRUE;
|
||||
twin->sort_dirty = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
xaccTransCommitEdit (newtrans);
|
||||
gnc_engine_generate_event (&newtrans->guid, GNC_EVENT_CREATE);
|
||||
|
||||
}
|
||||
|
||||
/* ================================================================ */
|
||||
|
||||
Reference in New Issue
Block a user