Skip to content

Commit

Permalink
Fix issue with hyperlinks xml tag being written to WorksheetXml when …
Browse files Browse the repository at this point in the history
…no hyperlinks exist in the worksheet
  • Loading branch information
JacobMilyli committed Oct 4, 2017
1 parent b41a758 commit 8d6a3f0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions EPPlus/ExcelWorksheet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3986,13 +3986,14 @@ private void UpdateHyperLinks(StreamWriter sw)
//foreach (ulong cell in _hyperLinks)
while(cse.Next())
{
if (first)
var uri = _hyperLinks.GetValue(cse.Row, cse.Column);
if (first && uri != null)
{
sw.Write("<hyperlinks>");
first = false;
}

//int row, col;
var uri = _hyperLinks.GetValue(cse.Row, cse.Column);
//ExcelCell cell = _cells[cellId] as ExcelCell;
if (uri is ExcelHyperLink && !string.IsNullOrEmpty((uri as ExcelHyperLink).ReferenceAddress))
{
Expand Down

0 comments on commit 8d6a3f0

Please sign in to comment.