From 089679d41057d36b51210121ccdf7a0a7f8917e8 Mon Sep 17 00:00:00 2001 From: Dan Siegel Date: Thu, 6 Jul 2023 20:24:27 -0600 Subject: [PATCH] chore: enabling nullability checks --- src/Prism.Core/Dialogs/DialogCloseEvent.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Prism.Core/Dialogs/DialogCloseEvent.cs b/src/Prism.Core/Dialogs/DialogCloseEvent.cs index c6102399a5..83d09c3474 100644 --- a/src/Prism.Core/Dialogs/DialogCloseEvent.cs +++ b/src/Prism.Core/Dialogs/DialogCloseEvent.cs @@ -2,6 +2,7 @@ using System.ComponentModel; using System.Threading.Tasks; +#nullable enable namespace Prism.Dialogs; /// @@ -16,7 +17,7 @@ public struct DialogCloseEvent /// public DialogCloseEvent() { - _callback = null; + _callback = () => { }; } /// @@ -43,7 +44,7 @@ public DialogCloseEvent(Func callback) /// Invokes the initialized delegate with no . /// public void Invoke() => - Invoke(null); + Invoke(new DialogParameters()); /// /// Invokes the initialized delegate with the specified . @@ -51,8 +52,6 @@ public void Invoke() => /// The . public async void Invoke(IDialogParameters parameters) { - parameters ??= new DialogParameters(); - switch(_callback) { case Action actionCallback: