Skip to content

Commit f14f1d0

Browse files
committed
Improved collection check. Tips for future: do not blindly trust CoPilot's suggestion
1 parent 6e02b55 commit f14f1d0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/Html2OpenXml/Expressions/Table/TableCellExpression.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public override IEnumerable<OpenXmlElement> Interpret (ParsingContext context)
4545

4646
// Word requires at least one paragraph in a cell
4747
// OpenXmlValidator does not catch this error
48-
if (!childElements.OfType<Paragraph>().Any())
48+
if (!childElements.Any(c => c is Paragraph))
4949
{
5050
childElements = childElements.Append(new Paragraph());
5151
}

0 commit comments

Comments
 (0)