Skip to content

Commit

Permalink
Update XSSFCellStyle.cs
Browse files Browse the repository at this point in the history
Fix Issue nissl-lab#1025
  • Loading branch information
devsikander authored Mar 29, 2023
1 parent 632de39 commit 64e5cd6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ooxml/XSSF/UserModel/XSSFCellStyle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public void CloneStyleFrom(ICellStyle source)
{
// Nice and easy
_cellXf = src.GetCoreXf().Copy();
_cellStyleXf = src.GetStyleXf().Copy();
_cellStyleXf = src.GetStyleXf() != null ? src.GetStyleXf().Copy() : null;
}
else
{
Expand Down Expand Up @@ -161,7 +161,7 @@ public void CloneStyleFrom(ICellStyle source)
CT_Border border = CT_Border.Parse(src.GetCTBorder().ToString());
AddBorder(border);

if (src._cellStyleXf.applyBorder)
if (src._cellStyleXf != null && src._cellStyleXf.applyBorder)
{
_cellStyleXf.borderId = FindAddBorder(src.GetCTBorder());
}
Expand Down Expand Up @@ -1279,7 +1279,7 @@ private int FontId
{
return (int)_cellXf.fontId;
}
return (int)_cellStyleXf.fontId;
return (int) (_cellStyleXf != null ? _cellStyleXf.fontId : 0);
}
}

Expand Down

0 comments on commit 64e5cd6

Please # to comment.