npoi icon indicating copy to clipboard operation
npoi copied to clipboard

XWPFTableRow.Copy() throws NullReferenceException

Open Zt-freak opened this issue 2 years ago • 3 comments

Every time I use Copy on XWPFTableRow it throws a NullReferenceException, but it doesn't show me which object is missing. I'm using 2.6.0

Example code:

XWPFTableRow testRow = new(new(), new(new(), new XWPFDocument()));
testRow.Copy();

Zt-freak avatar Dec 05 '22 08:12 Zt-freak

What does new(new(), new(new(), new XWPFDocument())) exactly mean?

tonyqus avatar Jul 31 '23 20:07 tonyqus

XWPFTableRow testRow = new XWPFTableRow(
    new CT_Row(),
    new XWPFTable(
        new CT_Tbl(),
        new XWPFDocument()
    )
);

Zt-freak avatar Aug 01 '23 20:08 Zt-freak

I've researched it and there is no such method in XWPFTableRow class, only CloneRow() exists, which is working fine. Seems Copy() is just an extension method from NPOI.Util. So, this issue can be closed as not a bug.

Bykiev avatar Feb 20 '24 19:02 Bykiev