Browse Source
Fix null pointer exception on application exit
pull/8478/head
javidsho
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
4 additions and
1 deletions
-
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) |
|
|
|
|