Resharper shows the warning "Possible Warning System.NullReferenceException". However, I do not see how I can get it.
public class PlaceController : PlanningControllerBase
{
[Authorize]
public ActionResult StartStop(int id)
{
if (Request != null && Request.Cookies != null && Request.Cookies["place"] != null)
{
if (Request.Cookies["place"].Value != null)
{
string placeInformation = Request.Cookies["place"].Value;
}
}
}
}
How can this give a NullReference if I check all fields? Using the following warning does not display a warning:
Request.Cookies[0];//Index instead of name
Edit: updated code.
Carra source
share