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 68:                     .Where(x => x.ProductInfoImages.Count() > 0 || x.imgUrls.Split(';').Count() >0)
Line 69:                     .Where(x => x.ProductEstateExts.FirstOrDefault().IsForSale == true);
Line 70:             Products = (list.Take(AmountToShow).ToList()).AsQueryable();
Line 71:         }
Line 72:     }

Source File: C:\Inetpub\vhosts\property-malta.biz\httpdocs\WBS_Modules\Shop\Sub_Modules\FrontEnd\LatestProducts.ascx.cs    Line: 70

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   lambda_method(Closure , ProductInfo ) +123
   System.Linq.WhereEnumerableIterator`1.MoveNext() +204
   System.Linq.<TakeIterator>d__25`1.MoveNext() +344
   System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +525
   System.Linq.Enumerable.ToList(IEnumerable`1 source) +68
   WBS_Modules_Shop_Sub_Modules_FrontEnd_LatestProducts.Page_Load(Object sender, EventArgs e) in C:\Inetpub\vhosts\property-malta.biz\httpdocs\WBS_Modules\Shop\Sub_Modules\FrontEnd\LatestProducts.ascx.cs:70
   System.Web.UI.Control.OnLoad(EventArgs e) +98
   System.Web.UI.Control.LoadRecursive() +153
   System.Web.UI.Control.LoadRecursive() +250
   System.Web.UI.Control.LoadRecursive() +250
   System.Web.UI.Control.LoadRecursive() +250
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4081


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