diff --git a/RhSolutions.AddIn/Services/ExcelWriter.cs b/RhSolutions.AddIn/Services/ExcelWriter.cs index ed4e2e0..4ac4f2b 100644 --- a/RhSolutions.AddIn/Services/ExcelWriter.cs +++ b/RhSolutions.AddIn/Services/ExcelWriter.cs @@ -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) {