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 92: 
Line 93:         var master = this.Page.Master as BespokeMasterPage;
Line 94:         master.SetCanonicalURL(currentUrl);
Line 95:     }
Line 96: 

Source File: e:\websites\WebApps\bira.co.uk\web\CMS_Themes\Default\MasterPages\DynamicPage.master.cs    Line: 94

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   CMS_Themes_Default_MasterPages_DynamicPage.LoadCanonicalUrl() in e:\websites\WebApps\bira.co.uk\web\CMS_Themes\Default\MasterPages\DynamicPage.master.cs:94
   CMS_Themes_Default_MasterPages_DynamicPage.OnInit(EventArgs e) in e:\websites\WebApps\bira.co.uk\web\CMS_Themes\Default\MasterPages\DynamicPage.master.cs:51
   System.Web.UI.Control.InitRecursive(Control namingContainer) +172
   System.Web.UI.Control.InitRecursive(Control namingContainer) +379
   System.Web.UI.Control.InitRecursive(Control namingContainer) +379
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +490


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