title: Episerver check if content area is empty
body: <p>I need to check if content area is empty but I get error "Object referrence not set to an instance" , this is my page controller i've tried also <code>currentPage.TabContentArea.IsEmpty</code>, still, same error. Content area is empty, this is first time Im trying to run it so I need to check is it empty before executing code inside if statement.</p>
  
  <pre><code>     public class StandardPageController : PageController&lt;StandardPage&gt;
      {
          // GET: StandardPage
          public   ActionResult Index( StandardPage currentPage)
          {
  
              // this collection should be used in foreach loops
              var tabItems = new List&lt;TabViewModel&gt;();
  
  
  //this is where I get error
              if(currentPage.TabContentArea.FilteredItems.Any())
  
   { 
              var contentAreaItems = currentPage.TabContentArea.FilteredItems.ToList();
              var contentLoader = ServiceLocator.Current.GetInstance&lt;IContentLoader&gt;();
  
              foreach (var contentAreaItem in contentAreaItems)
              {
                  // get an instance of Tab Block
                  // If you didn't set any restrictions, ContentArea can contain anything.
                  // We need to check if blockData is of type PageTab
                  var blockData = contentLoader.Get&lt;PageTab&gt;(contentAreaItem.ContentLink);
                  if (blockData == null) continue;
  
                  tabItems.Add(new TabViewModel
                  {
  
                      Id = Guid.NewGuid(),
                      Title = blockData.TabTitle,
                      Text = blockData.TabContent
                  });
              }
              ViewBag.items = tabItems;
              }
              return View(); // Should I return tabitems here ?
          }
      }
  </code></pre>