Skip to content

Instantly share code, notes, and snippets.

@mgroves
Created April 21, 2014 17:18
Show Gist options
  • Select an option

  • Save mgroves/11149339 to your computer and use it in GitHub Desktop.

Select an option

Save mgroves/11149339 to your computer and use it in GitHub Desktop.
public ActionResult MyAction()
{
var listResults = _service.GetAllResults(); // an exception here gets logged, but execution continues
var model = new MyViewModel();
model.NumResults = listResults.Count; // listResults is null, NullReferenceExcpetion here
return View(model);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment