error checking for insert-split

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@799 57a11ea4-9604-0410-9ed3-97b8803252fd
zzzoldfeatures/xacc-12-patch
Linas Vepstas 28 years ago
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…
Cancel
Save