title: An exception of type 'System.NullReferenceException' occurred in App_Web_***.dll
body: <p>This is my code</p>
  
  <pre><code>@if (ViewBag.last5Articles != null)
  {
      List&lt;Article&gt; articles = ViewBag.last5Articles;
      foreach (var article in articles)
      {
          &lt;div class="col-md-12"&gt;
              &lt;div class="row"&gt;
                  &lt;h2&gt;@article.Title&lt;/h2&gt;
              &lt;/div&gt;
              &lt;div class="row"&gt;
                  &lt;div class="col-md-6"&gt;
                      &lt;p&gt;@article.Body&lt;/p&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      }
  }
  </code></pre>
  
  <p>I put a breakpoint on the start of the foreach loop. I can see that article is not null and it has a title and a body. But when I reach article.Body and I press F10 (Step Over) suddenly it became Null!!</p>
  
  <blockquote>
    <p>"An exception of type <code>'System.NullReferenceException'</code> occurred in
    App_Web_ayg111kp.dll but was not handled in user code"</p>
  </blockquote>
  
  <p>.
  And when I finish debugging the yellow screen welcomes me with this message "<code>Object reference not set to an instance of an object</code>".</p>
  
  <p>Can anybody explain this problem to me please. I'm using .NET 4.5.2 and MVC 5.2</p>