Skip to content

Commit

Permalink
Fix ManagementException on old windows versions (#778)
Browse files Browse the repository at this point in the history
Dear users; please update from windows 7, it's a huge security risk.
  • Loading branch information
ScrubN authored Aug 3, 2023
1 parent d83b4a8 commit ea53fac
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions TwitchDownloaderWPF/Services/WindowsThemeService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ public class WindowsThemeService : ManagementEventWatcher

public WindowsThemeService()
{
// If windows version is before windows 10 or the windows 10 build is before 1809, it doesn't have the app theme registry key
if (Environment.OSVersion.Version.Major < 10 || Environment.OSVersion.Version.Build < 17763)
{
return;
}

var currentUser = WindowsIdentity.GetCurrent().User;

if (currentUser is null)
Expand Down

0 comments on commit ea53fac

Please sign in to comment.