Server Error in '/' Application.

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:


Line 37:                         _productsByManufactuer = ProductBusiness.GetProductsByManufacturerId(foundProduct.ProductManufacturer.Id);
Line 38: 
Line 39:                     var productCategory = ProductCategoryBusiness.GetProductCategoryById(_product.ProductCategories.FirstOrDefault().Id);
Line 40:                     if (productCategory != null)
Line 41:                     {

Source File: c:\inetpub\wwwroot\App_Data\Sitefinity\WebsiteTemplates\Default\App_Master\SubpageProductDetails.master.cs    Line: 39

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   DoubleEagleWebsite.SubpageProductDetails.OnPreRender(EventArgs e) in c:\inetpub\wwwroot\App_Data\Sitefinity\WebsiteTemplates\Default\App_Master\SubpageProductDetails.master.cs:39
   System.Web.UI.Control.PreRenderRecursiveInternal() +131
   System.Web.UI.Control.PreRenderRecursiveInternal() +226
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3670


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4110.0