title: Check object null or not
body: <p>I wanted to check if User exists or not in the database, and i take a User object and check if it is null or not.But the problem is in my code if user doen't exist in our database it returns following exception,</p>
  
  <blockquote>
    <blockquote>
      <p>Object reference not set to an instance of an object.</p>
    </blockquote>
  </blockquote>
  
  <p>I know this error happen when there is no such a user in our database.So.. i wanted to know if this user object( i want to return null or not) null or not.</p>
  
  <p>My Part of Code</p>
  
  <pre><code>  if(newsManager.GetUserUsingEmail(User.Email).Email != null) //If user doesn't exists this come the above mentioned exception
      {
          //User Exists
      }
      else
      {
         //User Doesn't exists
      }
  </code></pre>
  
  <p>How to solve it ?</p>