Browse Source

Fix null pointer exception on application exit

pull/8478/head
javidsho 4 years ago
committed by GitHub
parent
commit
65d1471a94
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