I have the variable $ {datetime} in the freemarker template. I pass null to it. I get an error

The following has evaluated to null or missing: 

The meaning is clear, yet I pass null.

But a condition like this <#if datetime == null> also gives an error.

How can I write a condition in freemarker that if null, then one action is different?

    1 answer 1

    Found a solution to your question.

    If you need to check for null or missing, then it’s enough to make a trace in the freemarker template. check <#if datetime??> .

    That is, two question marks are used for this test.