Skip to content

Commit 15fedad

Browse files
authored
Merge pull request #2377 from EPPlusSoftware/bug/issue2376
Fixes issue 2376
2 parents c58eb06 + c5cd08e commit 15fedad

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

src/EPPlus/Core/CellStore/RangeDictionary.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ internal bool Exists(int row, int col)
133133
}
134134
internal List<T> GetValuesFromRange(int fromRow, int fromCol, int toRow, int toCol)
135135
{
136+
if (_addresses.Keys.Count == 0) return new List<T>();
136137
var hs = new HashSet<T>();
137138
long rowSpan = ((fromRow - 1) << 20) | (fromRow - 1);
138139
var searchItem = new RangeItem(rowSpan, default);

src/EPPlusTest/DataValidation/DataValidationTests.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1295,5 +1295,12 @@ public void DataValidationsPerformance()
12951295
SaveAndCleanup(p);
12961296
}
12971297
}
1298-
}
1298+
[TestMethod]
1299+
public void VerifyClearDataValidationOnEmptyRange()
1300+
{
1301+
using var p = new ExcelPackage();
1302+
var ws = p.Workbook.Worksheets.Add("Sheet1");
1303+
ws.Cells[1, 1, 4, 4].DataValidation.ClearDataValidation();
1304+
}
1305+
}
12991306
}

0 commit comments

Comments
 (0)