diff --git a/DesktopNotifications.FreeDesktop/FreeDesktopNotificationManager.cs b/DesktopNotifications.FreeDesktop/FreeDesktopNotificationManager.cs index c95b88c..48c18ae 100644 --- a/DesktopNotifications.FreeDesktop/FreeDesktopNotificationManager.cs +++ b/DesktopNotifications.FreeDesktop/FreeDesktopNotificationManager.cs @@ -158,10 +158,11 @@ private void OnNotificationActionInvokedError(Exception obj) private void OnNotificationActionInvoked((uint id, string actionKey) @event) { - if (!_activeNotifications.TryGetValue(@event.id, out var notification)) return; + if (!_activeNotifications.TryGetValue(@event.id, out var notification) || notification is null) return; NotificationActivated?.Invoke(this, new NotificationActivatedEventArgs(notification, @event.actionKey)); + _activeNotifications.Remove(@event.id); } } }