mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
error checking for insert-split
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@799 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
df53298e0b
commit
9159e65a9d
@ -535,11 +535,20 @@ xaccTransAppendSplit (Transaction *trans, Split *split)
|
||||
{
|
||||
int i, num;
|
||||
Split **oldarray;
|
||||
Transaction *oldtrans;
|
||||
|
||||
if (!trans) return;
|
||||
if (!split) return;
|
||||
|
||||
/* first, make sure that the split isn't already inserted
|
||||
* elsewhere. If so, then remove it. */
|
||||
oldtrans = split->parent;
|
||||
if (oldtrans) {
|
||||
xaccTransRemoveSplit (oldtrans, split);
|
||||
xaccTransRebalance (oldtrans);
|
||||
}
|
||||
|
||||
/* first, insert the split into the array */
|
||||
/* now, insert the split into the array */
|
||||
split->parent = trans;
|
||||
num = xaccCountSplits (trans->splits);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user