Fix empty ProductLines field exception on writing

This commit is contained in:
Sergey Chebotar 2023-05-16 17:04:30 +03:00
parent 46e547e3e2
commit 786a5bfe26

View File

@ -182,7 +182,7 @@ public class ExcelWriter : IWriter, IDisposable
previous.Copy(current);
current.ClearContents();
worksheetCells[row, groupColumn].Value2 = positionAmount.Key.ProductLines.First();
worksheetCells[row, groupColumn].Value2 = positionAmount.Key.ProductLines.FirstOrDefault() ?? string.Empty;
worksheetCells[row, nameColumn].Value2 = positionAmount.Key.Name;
if (_oldSkuCell != null)