Error executing template "/Designs/SkanskaMaskin/Paragraph/_form_retur.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at Softgear.SkanskaMaskin.Data.Entities.Rental.Return.renderReturnForm() in C:\Dev\Skanskamaskin\main\Softgear.SkanskaMaskin.Data\Entities\Rental\Return.cs:line 22
   at CompiledRazorTemplates.Dynamic.RazorEngine_80be46c499af44dea24d59d5945e3ab1.Execute() in D:\wwwroot\rental.skanska.se\Files\Templates\Designs\SkanskaMaskin\Paragraph\_form_retur.cshtml:line 65
   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.b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2 @using Softgear.SkanskaMaskin.Data.Business 3 @using Softgear.SkanskaMaskin.Data.Entities.Rental 4 @using Softgear.SkanskaMaskin.Data.Helper 5 6 7 @{ 8 var hbh = new HandleBarsHelper(); 9 10 var customerCenters = CacheManager.GetFromCache<Dynamicweb.Security.UserManagement.UserCollection>(60, "customerCentersGroup4", () => Dynamicweb.Security.UserManagement.User.GetUsersByGroupID(4)); 11 var choose = new Dynamicweb.Security.UserManagement.User(); 12 13 var storeList = (from user in customerCenters.Where(y => y.Active) 14 select new 15 { 16 value = Convert.ToString(user.ID), 17 text = user.Name 18 }).OrderBy(x => x.text).ToList(); 19 20 storeList.Insert(0, new { value = "", text = Translate("Choose_KC", "Välj kundcenter") }); 21 22 23 var storesData = new 24 { 25 baseUrl = "/service/storeinfo?storeid=", 26 name = "store", 27 required = "required", 28 className = "Control--light", 29 items = storeList.ToArray() 30 }; 31 32 33 var project = ProjectManager.getProject(AccountManager.getActiveProjectCode()); 34 var returnForm = new Return(project); 35 } 36 37 <form action="/dashboard/returer/ny" method="get"> 38 <div class="Grid Grid--equalPush"> 39 <div class="Grid-cell"> 40 <div class="Grid Grid--withGutter"> 41 <div class="Grid-cell u-sizeFull"> 42 <div class="Type"> 43 <h2 class="Type-h1">Bekräfta och beställ retur</h2> 44 </div> 45 </div> 46 <div class="Grid-cell u-sizeFull u-md-size1of2 u-lg-size1of2"> 47 Välj kundcenter 48 </div> 49 <div class="Grid-cell u-sizeFull u-md-size1of2 u-lg-size1of2"> 50 @hbh.render("control/index.hbs", storesData) 51 </div> 52 </div> 53 </div> 54 <div class="Grid-cell"> 55 <div class="Grid Grid--withGutter"> 56 <div class="Grid-cell u-sizeFull"> 57 @returnForm.renderSummary() 58 </div> 59 </div> 60 </div> 61 <div class="Grid-cell"> 62 <div class="Grid Grid--withGutter"> 63 <div class="Grid-cell"> 64 <div class="Byline"> 65 @returnForm.renderReturnForm() 66 </div> 67 </div> 68 </div> 69 </div> 70 <div class="Grid-cell"> 71 <div class="Grid Grid--withGutter"> 72 <div class="Grid-cell u-sizeFull"> 73 <div class="Type"> 74 <h3 class="Type-h3">Övrig information</h3> 75 </div> 76 </div> 77 <div class="Grid-cell u-sizeFull"> 78 <div class="Input Input--fill"> 79 <label for="return-message" class="Input-label">Meddelande</label> 80 <textarea id="return-message" class="Input-textarea js-formInputField" name="return-message" data-controller="form-input" rows="3" style="overflow: hidden; word-wrap: break-word; resize: horizontal; height: 97px;"> </textarea> 81 </div> 82 </div> 83 </div> 84 </div> 85 <input type="hidden" name="project" value="58460"> 86 <div class="Grid-cell"> 87 <div class="Grid Grid--withGutter"> 88 <div class="Grid-cell u-size1of2 u-textLeft"> 89 <button class="Button Button--tertiary js-overlayClose" type="submit">Avbryt</button> 90 </div> 91 <div class="Grid-cell u-size1of2 u-textRight"> 92 <button class="Button" type="submit">Beställ retur</button> 93 </div> 94 </div> 95 </div> 96 </div> 97 </form>