Bug 797984 - Infinite loop while Check&Repair AR and AP accounts

If using the Check&Repair option from the Chart of Accounts on 'Account
Receivable or Payable' add has a voided transaction will cause an
infinite loop.

This occurs from checking the transaction split amount is zero in
gncScrubBusinessSplit and trying to delete it. As the transaction is
read only as a result of being voided this fails so add a further
condition for the 'else if' statement to include !is_void.
This commit is contained in:
Robert Fewell 2020-10-20 14:45:44 +01:00
parent 794b31a98e
commit 8e5e3480ad

View File

@ -582,7 +582,7 @@ gncScrubBusinessSplit (Split *split)
* Such splits may be the result of scrubbing the business lots, which can
* merge splits together while reducing superfluous lot links
*/
else if (gnc_numeric_zero_p (xaccSplitGetAmount(split)) && !gncInvoiceGetInvoiceFromTxn (txn))
else if (gnc_numeric_zero_p (xaccSplitGetAmount(split)) && !gncInvoiceGetInvoiceFromTxn (txn) && !is_void)
{
GNCLot *lot = xaccSplitGetLot (split);
time64 pdate = xaccTransGetDate (txn);