Skip to content

Commit

Permalink
fix(Profile::TrayIcon): possible null case when profile manager isn't…
Browse files Browse the repository at this point in the history
… defined yet

And the user click on the tray icon.

Fixes SOUNDSWITCH-F
  • Loading branch information
Belphemur committed May 8, 2021
1 parent 0a5da99 commit 234d5bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion SoundSwitch/Framework/Profile/UI/ProfileTrayIconBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class ProfileTrayIconBuilder
/// <returns></returns>
public IEnumerable<ToolStripMenuItem> GetMenuItems()
{
return ProfileManager.Profiles
return (ProfileManager?.Profiles ?? new Profile[0])
.Where(profile => profile.Triggers.Any(trigger => trigger.Type == TriggerFactory.Enum.TrayMenu))
.Select(BuildMenuItem);
}
Expand Down

0 comments on commit 234d5bf

Please sign in to comment.