In XDocReport, how to handle null value?
<p>Is there a way to handle null value for a  field in XDocReport? or do I need to manipulate it on my own? example: </p>

<pre><code>if (thisVar == null)
  context.put("sampleText", "");
else
  context.put("sampleText", thisVar);
</code></pre>

<p>or is there an option in docx quick parts?</p>

<p>I found this line in the error message of XDocReport. However I could not understand where to apply this, in the template or in the code.</p>

<blockquote>
  <p>Tip: If the failing expression is known to be legally refer to
  something that's sometimes null or missing, either specify a default
  value like myOptionalVar!myDefault, or use [#if
  myOptionalVar??]when-present[#else]when-missing[/#if]. (These only
  cover the last step of the expression; to cover the whole expression,
  use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??</p>
</blockquote>