mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-21 10:14:26 +08:00
check whether split quantity node exists
This commit is contained in:
@@ -136,6 +136,10 @@ func (t *gnucashTransactionDataRowIterator) parseTransaction(ctx core.Context, u
|
||||
return nil, false, errs.ErrMissingAccountData
|
||||
}
|
||||
|
||||
if splitData1.Quantity == "" || splitData2.Quantity == "" {
|
||||
return nil, false, errs.ErrAmountInvalid
|
||||
}
|
||||
|
||||
amount1, err := t.parseAmount(splitData1.Quantity)
|
||||
|
||||
if err != nil {
|
||||
@@ -253,6 +257,10 @@ func (t *gnucashTransactionDataRowIterator) parseTransaction(ctx core.Context, u
|
||||
return nil, false, errs.ErrMissingAccountData
|
||||
}
|
||||
|
||||
if splitData.Quantity == "" {
|
||||
return nil, false, errs.ErrAmountInvalid
|
||||
}
|
||||
|
||||
amount, err := t.parseAmount(splitData.Quantity)
|
||||
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user