title: How to use try, catch in System.NullReferenceException (Object reference not set to an instance of an object)
body: <p>I query my data from database to display in my view. 
  I used this query :</p>
  
  <pre><code>var ien_content = from c in this.DataContext.tbl_Contents
                where c.ContentTypeID == id
                &amp;&amp;
                (
                IsActive == false?true :(c.Active == null?true:c.Active &gt; 0)
                )
                orderby c.RegisterDate descending 
                select c;
  return ien_content.ToList();
  </code></pre>
  
  <p>There are many rows in this tbl_Contents, but when all of these rows are set Active = 0, it show the error : System.NullReferenceException: Object reference not set to an instance of an object.</p>
  
  <p>Anyone can tell me, how to catch this error? Thanks.</p>