title: Check if hydrated doctrine result is NULL
body: <p>I'm trying to check if a result in my DQL is NULL.</p>
  
  <p>I got the following DQL query:</p>
  
  <pre><code>    $q = self::createQuery("l")
          -&gt;select('i.*, s.aantal, m.naam, c.cat_naam, a.app_id')
          -&gt;from('InstalledBase i, i.Spare s, i.Apparaat a, a.Categorie c, a.Merk m')
          -&gt;execute();
  
      return $q;
  </code></pre>
  
  <p>Now i want to check if the s.aantal is NULL so i do:</p>
  
  <pre><code>if(is_null($installedbase-&gt;Spare-&gt;spare_id))
  </code></pre>
  
  <p>when the variable is NOT null everything works, but when it is actually NULL i get a E notice message:</p>
  
  <pre><code>Notice: Trying to get property of non-object in \installedbase\templates\_index.php on line 29
  </code></pre>
  
  <p>It does see that it is null though because the if condition is executed.</p>
  
  <p>Weird thing is i'm doing the exact same thing on another page where it works no problem.
  But i must be doing something wrong or stupid since those messages generally don't show for nothing.</p>
  
  <p>So can anybody explain this to me? :)</p>