aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Chebotar <s.chebotar@gmail.com>2023-05-16 17:04:30 +0300
committerSergey Chebotar <s.chebotar@gmail.com>2023-05-16 17:04:30 +0300
commit786a5bfe2638477576ca2936174cfd83d2d03bba (patch)
treec33b1e99c503fa72e49f73f15d7cf0e00d608149
parent46e547e3e26dd80ef15d02f09b24578d37bf1104 (diff)
Fix empty ProductLines field exception on writing
-rw-r--r--RhSolutions.AddIn/Services/ExcelWriter.cs2
1 files changed, 1 insertions, 1 deletions
diff --git a/RhSolutions.AddIn/Services/ExcelWriter.cs b/RhSolutions.AddIn/Services/ExcelWriter.cs
index 4ac4f2b..ab04c50 100644
--- a/RhSolutions.AddIn/Services/ExcelWriter.cs
+++ b/RhSolutions.AddIn/Services/ExcelWriter.cs
@@ -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)