added try catch
This commit is contained in:
@@ -349,6 +349,8 @@ namespace CarCareTracker.Logic
|
||||
int monthMultiplier = 1;
|
||||
var originalDate = recurringFee.Date;
|
||||
while (isOutdated)
|
||||
{
|
||||
try
|
||||
{
|
||||
var nextDate = originalDate.AddMonths(monthInterval * monthMultiplier);
|
||||
monthMultiplier++;
|
||||
@@ -359,6 +361,11 @@ namespace CarCareTracker.Logic
|
||||
_taxRecordDataAccess.SaveTaxRecordToVehicle(recurringFee);
|
||||
isOutdated = !recurringFee.IsRecurring;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
isOutdated = false; //break out of loop if something broke.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user