|
|
@@ -87,7 +87,7 @@ public sealed class ExcelDynamicReader : IDisposable
|
|
|
|
|
|
public IEnumerable<List<DynamicCell>> Read(int worksheetIndex = 1, uint startFrom = 1, uint skip = 0)
|
|
|
{
|
|
|
- if (worksheetIndex > xlWorkbook.Worksheets.Count) yield break;
|
|
|
+ if (worksheetIndex < 1 || worksheetIndex > xlWorkbook.Worksheets.Count) yield break;
|
|
|
|
|
|
var worksheet = xlWorkbook.Worksheets.FirstOrDefault(x => x.Position == worksheetIndex);
|
|
|
if (worksheet == null) yield break;
|