title: How to compare for null in groovy correctly?
body: <p>edit: Stupid. The problem was that I got a string with value 'null'</p>
  
  <hr>
  
  <p>How to compare for null in groovy correctly?</p>
  
  <p>I've got the following script</p>
  
  <pre><code>println "row6: " + row[6]
  
  if(row[6] == null) {
    println "if"
  }
    else {
    println "else"
  }
  </code></pre>
  
  <p>When I run it with a row where the specified field is null this is the output:</p>
  
  <pre><code>row6: null
  else
  </code></pre>
  
  <p>The <a href="http://groovy.codehaus.org/Differences+from+Java" rel="noreferrer">Groovy Docs</a> say <code>a == null</code> will work, while <code>a.is(null)</code> will not.</p>
  
  <p>So how do I compare for null in groovy the right way?</p>
  
  <p>P.S. I saw <a href="https://stackoverflow.com/questions/13532582/comparing-null-and-number-in-groovy">The SO-Thread: comparing-null-and-number-in-groovy</a>. It says that null is handled as a number, but this would still mean a <code>==</code> comparision should work when the value is null.</p>