Skip to content

Commit dad3851

Browse files
authored
Fix editing of variannts (#1411)
1 parent 4ed753e commit dad3851

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/JoinRpg.Portal/Controllers/GameFieldController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ await FieldSetupService.UpdateFieldValueVariant(new UpdateFieldValueVariantReque
285285
viewModel.ProgrammaticValue,
286286
viewModel.Price,
287287
viewModel.PlayerSelectable,
288-
viewModel.GetTimeSlotRequest(field, Request.Form["TimeSlotStartTime"][0])
288+
viewModel.GetTimeSlotRequest(field, Request.Form["TimeSlotStartTime"].FirstOrDefault())
289289
));
290290

291291
return RedirectToAction("Edit", new { viewModel.ProjectId, projectFieldId = viewModel.ProjectFieldId });

src/JoinRpg.WebPortal.Models/FieldSetup/GameFieldDropdownValueViewModelBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ public GameFieldDropdownValueViewModelBase(ProjectField field)
6161

6262
public GameFieldDropdownValueViewModelBase() { }
6363

64-
public TimeSlotOptions? GetTimeSlotRequest(ProjectField field, string value)
64+
public TimeSlotOptions? GetTimeSlotRequest(ProjectField field, string? value)
6565
{
66-
return field.IsTimeSlot()
66+
return value is not null && field.IsTimeSlot()
6767
? new TimeSlotOptions
6868
{
6969
StartTime = DateTimeOffset.ParseExact(

0 commit comments

Comments
 (0)