浏览代码

Cosmetics

Piotr Czajkowski 2 周之前
父节点
当前提交
c4002192fc
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      ExcelORM/ExcelORM/ExcelWriter.cs

+ 5 - 1
ExcelORM/ExcelORM/ExcelWriter.cs

@@ -83,7 +83,11 @@ public class ExcelWriter : IDisposable
         List<Mapping>? mapping = [];
 
         var lastRow = worksheet.LastRowUsed();
-        if (lastRow == null) append = false;
+        if (lastRow == null)
+        {
+            append = false;
+            lastRow = worksheet.FirstRow();
+        }
         
         var rowIndex = (append, startFrom) switch
         {