diff --git a/src/Avalonia.Controls/Notifications/WindowNotificationManager.cs b/src/Avalonia.Controls/Notifications/WindowNotificationManager.cs index cb7ade44b3..6d9a030ead 100644 --- a/src/Avalonia.Controls/Notifications/WindowNotificationManager.cs +++ b/src/Avalonia.Controls/Notifications/WindowNotificationManager.cs @@ -54,9 +54,12 @@ namespace Avalonia.Controls.Notifications /// Initializes a new instance of the class. /// /// The TopLevel that will host the control. - public WindowNotificationManager(TopLevel host) : this() + public WindowNotificationManager(TopLevel? host) : this() { - InstallFromTopLevel(host); + if (host is not null) + { + InstallFromTopLevel(host); + } } ///