Skip to content

Commit

Permalink
Backport RemoveIcons NRE fix
Browse files Browse the repository at this point in the history
  • Loading branch information
maxkatz6 authored Jul 20, 2022
1 parent dd8ed9c commit 855a193
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Avalonia.Controls/TrayIcon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ private static void Lifetime_Exit(object sender, ControlledApplicationLifetimeEx

private static void Icons_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
{
RemoveIcons(e.OldItems.Cast<TrayIcon>());
if (e.OldItems is not null)
RemoveIcons(e.OldItems.Cast<TrayIcon>());
}

private static void RemoveIcons(IEnumerable<TrayIcon> icons)
Expand Down

0 comments on commit 855a193

Please sign in to comment.