diff --git a/Elwig/Windows/BaseDataWindow.xaml.cs b/Elwig/Windows/BaseDataWindow.xaml.cs index 267a836..7487a86 100644 --- a/Elwig/Windows/BaseDataWindow.xaml.cs +++ b/Elwig/Windows/BaseDataWindow.xaml.cs @@ -148,7 +148,7 @@ namespace Elwig.Windows { protected override async Task OnRenewContext(AppDbContext ctx) { await base.OnRenewContext(ctx); - FillInputs(App.Client, (await ctx.Seasons.FindAsync(Utils.CurrentLastSeason))!); + FillInputs(App.Client, await ctx.Seasons.FindAsync(Utils.CurrentLastSeason)); ControlUtils.RenewItemsSource(SeasonList, await ctx.Seasons .OrderByDescending(s => s.Year) .Include(s => s.Modifiers) @@ -274,7 +274,7 @@ namespace Elwig.Windows { using var ctx = new AppDbContext(); ClearInputStates(); - FillInputs(App.Client, (await ctx.Seasons.FindAsync(Utils.CurrentLastSeason))!); + FillInputs(App.Client, await ctx.Seasons.FindAsync(Utils.CurrentLastSeason)); LockInputs(); } @@ -294,7 +294,7 @@ namespace Elwig.Windows { using var ctx = new AppDbContext(); ClearInputStates(); - FillInputs(App.Client, (await ctx.Seasons.FindAsync(Utils.CurrentLastSeason))!); + FillInputs(App.Client, await ctx.Seasons.FindAsync(Utils.CurrentLastSeason)); UpdateButtons(); } @@ -325,14 +325,14 @@ namespace Elwig.Windows { using (var ctx = new AppDbContext()) { ClearInputStates(); - FillInputs(App.Client, (await ctx.Seasons.FindAsync(Utils.CurrentLastSeason))!); + FillInputs(App.Client, await ctx.Seasons.FindAsync(Utils.CurrentLastSeason)); LockInputs(); } await HintContextChange(); } - private void FillInputs(ClientParameters p, Season s) { + private void FillInputs(ClientParameters p, Season? s) { ClearOriginalValues(); ClearDefaultValues(); @@ -363,9 +363,9 @@ namespace Elwig.Windows { TextElementDeliveryConfirmation.Text = p.TextDeliveryConfirmation; TextElementCreditNote.Text = p.TextCreditNote; - ParameterAllowAttrIntoLowerInput.IsChecked = s.Billing_AllowAttrsIntoLower; - ParameterAvoidUnderDeliveriesInput.IsChecked = s.Billing_AvoidUnderDeliveries; - ParameterHonorGebundenInput.IsChecked = s.Billing_HonorGebunden; + ParameterAllowAttrIntoLowerInput.IsChecked = s?.Billing_AllowAttrsIntoLower ?? false; + ParameterAvoidUnderDeliveriesInput.IsChecked = s?.Billing_AvoidUnderDeliveries ?? false; + ParameterHonorGebundenInput.IsChecked = s?.Billing_HonorGebunden ?? false; FinishInputFilling(); }