title: Freemarker function with parameter that can be empty
body: <p>I created function in Freemarker:</p>
  
  <pre>
  &lt;#function formatDate anyDate>
      &lt;#assign dateFormat = read_from_configuration() />
      &lt;#if anyDate??>
          &lt;#return anyDate?date(dateFormat) />
      &lt;#else >
          &lt;#return '' />
      &lt;/#if>
  &lt;/#function>
  </pre>
  
  <p>I call it like this: <code>${formatDate(object.someDate)}</code>.</p>
  
  <p>It all works until <code>someDate</code> is null. In that case I get exception:</p>
  
  <pre>
  Error executing macro: formatDate
  required parameter: anyDate is not specified.
  </pre>
  
  <p>How can I do this? I want the function to work if parameter values is null.</p>