From 234d5bf07e9d77e8c774d6ce2be5ae9330573acf Mon Sep 17 00:00:00 2001 From: Antoine Aflalo Date: Sat, 8 May 2021 17:37:18 -0400 Subject: [PATCH] fix(Profile::TrayIcon): possible null case when profile manager isn't defined yet And the user click on the tray icon. Fixes SOUNDSWITCH-F --- SoundSwitch/Framework/Profile/UI/ProfileTrayIconBuilder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SoundSwitch/Framework/Profile/UI/ProfileTrayIconBuilder.cs b/SoundSwitch/Framework/Profile/UI/ProfileTrayIconBuilder.cs index a0a22311cf..766293a84f 100644 --- a/SoundSwitch/Framework/Profile/UI/ProfileTrayIconBuilder.cs +++ b/SoundSwitch/Framework/Profile/UI/ProfileTrayIconBuilder.cs @@ -22,7 +22,7 @@ public class ProfileTrayIconBuilder /// public IEnumerable GetMenuItems() { - return ProfileManager.Profiles + return (ProfileManager?.Profiles ?? new Profile[0]) .Where(profile => profile.Triggers.Any(trigger => trigger.Type == TriggerFactory.Enum.TrayMenu)) .Select(BuildMenuItem); }