Skip to content

Commit 9e3ef26

Browse files
committed
Add null support for multi line if
1 parent b2e92de commit 9e3ef26

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

samples/docx/TestIfStatement.docx

-44 Bytes
Binary file not shown.

src/MiniWord/MiniWord.Implment.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,8 @@ private static void ReplaceStatements(OpenXmlElement xmlElement, Dictionary<stri
506506

507507
var statement = paragraphs[ifIndex].InnerText.Split(' ');
508508

509-
var tagValue = tags[statement[1]];
509+
var tagValue = tags[statement[1]] ?? "NULL";
510+
510511
var checkStatement = statement.Length == 4 ? EvaluateStatement(tagValue.ToString(), statement[2], statement[3]) : !bool.Parse(tagValue.ToString());
511512

512513
if (!checkStatement)

0 commit comments

Comments
 (0)