Fix empty product lines exception
This commit is contained in:
parent
6d9ff9365c
commit
ac978419ae
@ -110,7 +110,7 @@ public class ExcelWriter : IWriter, IDisposable
|
||||
Range worksheetCells = _worksheet.Cells;
|
||||
Range skuColumn = _skuCell.EntireColumn;
|
||||
|
||||
int? row = GetPositionRow(skuColumn, positionAmount.Key.ProductSku.ToString(), positionAmount.Key.ProductLines.First());
|
||||
int? row = GetPositionRow(skuColumn, positionAmount.Key.ProductSku.ToString(), positionAmount.Key.ProductLines.FirstOrDefault());
|
||||
|
||||
if (row != null)
|
||||
{
|
||||
@ -126,7 +126,7 @@ public class ExcelWriter : IWriter, IDisposable
|
||||
|
||||
if (_oldSkuCell != null)
|
||||
{
|
||||
row = GetPositionRow(_oldSkuCell.EntireColumn, positionAmount.Key.ProductSku.ToString(), positionAmount.Key.ProductLines.First());
|
||||
row = GetPositionRow(_oldSkuCell.EntireColumn, positionAmount.Key.ProductSku.ToString(), positionAmount.Key.ProductLines.FirstOrDefault());
|
||||
|
||||
if (row != null)
|
||||
{
|
||||
@ -142,7 +142,7 @@ public class ExcelWriter : IWriter, IDisposable
|
||||
}
|
||||
|
||||
string sku = positionAmount.Key.ProductSku.Article;
|
||||
row = GetPositionRow(skuColumn, sku, positionAmount.Key.ProductLines.First());
|
||||
row = GetPositionRow(skuColumn, sku, positionAmount.Key.ProductLines.FirstOrDefault());
|
||||
|
||||
if (row != null)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user