Error executing template "Designs/Swift/Paragraph/DSC_Event_Content.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_afa419a244184528b45cc8b99305807b.Execute() in D:\dynamicweb.net\Solutions\NexusOne\DanskeShoppingcentre.cloud.dynamicweb-cms.com\files\Templates\Designs\Swift\Paragraph\DSC_Event_Content.cshtml:line 8
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
   at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
   at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 2 @using Dynamicweb.Frontend 3 @using DSCBackend; 4 5 @{ object tempObject; 6 Pageview.Item.TryGetValue(EventConstants.SYSNAME_ContentType, out tempObject); 7 int eventType = 1; 8 int.TryParse(tempObject.ToString(), out eventType); 9 10 switch (eventType) 11 { 12 case 1: 13 { 14 <div>@RenderPartial("Paragraph/EventContent/1.Oplevelse.cshtml", Model)</div> 15 break; 16 } 17 case 2: 18 { 19 <div>@RenderPartial("Paragraph/EventContent/2.Konkurrence.cshtml", Model)</div> 20 break; 21 } 22 default: 23 { 24 <div>@RenderPartial("Paragraph/EventContent/1.Oplevelse.cshtml", Model)</div> 25 break; 26 } 27 28 } } 29