[#3] ElwigData: Fix import error when no deliveries are present
All checks were successful
Test / Run tests (push) Successful in 2m31s

This commit is contained in:
2024-07-27 19:30:22 +02:00
parent a5164e286f
commit 662862090e

View File

@ -574,7 +574,10 @@ namespace Elwig.Helpers.Export {
var year = json["year"]!.AsValue().GetValue<int>();
var lsnr = json["lsnr"]!.AsValue().GetValue<string>();
var did = currentLsNrs.GetValueOrDefault(lsnr, -1);
if (did == -1) did = ++currentDids[year];
if (did == -1) {
if (!currentDids.ContainsKey(year)) currentDids[year] = 0;
did = ++currentDids[year];
}
currentLsNrs[lsnr] = did;
return (new Delivery {
Year = year,