title: Check, if a variable is null in a view
body: <p>The following is a code segment from <code>person.gsp</code></p>
  
  <pre><code>&lt;g:set var="res" value="${ Person.get(personInstance.id) }" /&gt;
                              ${ res.result }
  </code></pre>
  
  <p>I get the following error message. </p>
  
  <pre><code>Cannot get property 'result' on null object
  </code></pre>
  
  <p>How can i do a validation to check if <code>result</code> is <code>null</code> from the <code>view</code> itself ?</p>
  
  <p>Note: I don't want to do this validation from the <code>controller</code></p>
  
  <p>UPDATE</p>
  
  <p>Can i do a </p>
  
  <pre><code>&lt;g:if........${ Person.get(personInstance.id) } NOT EQUAL TO NULL THEN
  &lt;g:set var="res" value="${ Person.get(personInstance.id) }" /&gt;
                                  ${ res.result }
  </code></pre>
  
  <p>Kind of a thing ? If so how to do it ?</p>