Browse Source

Merge pull request #8478 from javidsho/patch-1

Fix TrayIcon null pointer exception on application exit
pull/8483/head
Max Katz 4 years ago
committed by GitHub
parent
commit
0e115413e4
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      src/Avalonia.Controls/TrayIcon.cs

5
src/Avalonia.Controls/TrayIcon.cs

@ -189,7 +189,10 @@ namespace Avalonia.Controls
var app = Application.Current ?? throw new InvalidOperationException("Application not yet initialized.");
var trayIcons = GetIcons(app);
RemoveIcons(trayIcons);
if (trayIcons != null)
{
RemoveIcons(trayIcons);
}
}
private static void Icons_CollectionChanged(object? sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)

Loading…
Cancel
Save