From f86ad05a019e01b4ffac661a615683fbaa68e3fe Mon Sep 17 00:00:00 2001 From: rabbitism Date: Fri, 3 Feb 2023 23:04:03 +0800 Subject: [PATCH] misc: fix a build warning. --- demo/Semi.Avalonia.Demo/Pages/NotificationDemo.axaml.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/demo/Semi.Avalonia.Demo/Pages/NotificationDemo.axaml.cs b/demo/Semi.Avalonia.Demo/Pages/NotificationDemo.axaml.cs index bdaf029..2b256b5 100644 --- a/demo/Semi.Avalonia.Demo/Pages/NotificationDemo.axaml.cs +++ b/demo/Semi.Avalonia.Demo/Pages/NotificationDemo.axaml.cs @@ -12,7 +12,7 @@ namespace Semi.Avalonia.Demo.Pages; public partial class NotificationDemo : UserControl { - private WindowNotificationManager _manager; + private WindowNotificationManager? _manager; public NotificationDemo() { InitializeComponent(); @@ -29,7 +29,7 @@ public partial class NotificationDemo : UserControl { if (sender is Button b && b.Content is string s && Enum.TryParse(s, out NotificationType t)) { - _manager.Show(new Notification(t.ToString(), "This is message", t)); + _manager?.Show(new Notification(t.ToString(), "This is message", t)); } } } \ No newline at end of file