title: Membership.GetUser results In Object Reference Not Set to Instance Of An Object
body: <p>I am trying to get the SQL results for the logged in user using:</p>
  
  <pre><code>// GET: /Incident/
  public ActionResult Index()
  {
      var loggedInUser = Membership.GetUser().ProviderUserKey.ToString();
      var query = from b in db.Logs where b.Id == loggedInUser select b;
      return View(query.ToList());
  }
  </code></pre>
  
  <p>But the first line of the method results in a NullReferenceException and I'm unsure why?</p>