title: Cannot read property 'name' of null
body: <p>So my problem is that sometimes <code>data.content[i].location.name</code> returns an error saying cannot read property 'name' of null.</p>
  
  <pre><code>for ( var i = 0; i &lt; len; i++ ) {
      classes.push({
         "id":data.post[i].id,
         "location":data.content[i].location.name,
         "type":data.content[i].type
     });
  }
  </code></pre>
  
  <p>How can i fix this issue? I need data.content[i].location.name if it is not null.</p>