From e054278cdd80dda7000a326b3726baece0cb767e Mon Sep 17 00:00:00 2001 From: Bobbie Hodgetts Date: Fri, 7 May 2021 11:45:42 +0100 Subject: [PATCH] Bug Fix: Exception on deletion of first invoice in list --- src/bnhtrade.Core/Logic/Export/AmazonSettlement.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/bnhtrade.Core/Logic/Export/AmazonSettlement.cs b/src/bnhtrade.Core/Logic/Export/AmazonSettlement.cs index 3fbae60..5826447 100644 --- a/src/bnhtrade.Core/Logic/Export/AmazonSettlement.cs +++ b/src/bnhtrade.Core/Logic/Export/AmazonSettlement.cs @@ -222,7 +222,10 @@ namespace bnhtrade.Core.Logic.Export if (invoiceList[i].InvoiceLineList.Count == 0) { invoiceList.RemoveAt(i); - i = i - 1; + if (i > 0) + { + i = i - 1; + } } } // get here add info to lines