Skip to content

Commit 2c66f01

Browse files
Null check when reading regkey
1 parent c9db565 commit 2c66f01

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Flow.Launcher/Helper/WindowsMediaPlayerHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ internal static class WindowsMediaPlayerHelper
66
internal static bool IsWindowsMediaPlayerInstalled()
77
{
88
using var key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\MediaPlayer");
9-
return key.GetValue("Installation Directory") != null;
9+
return key?.GetValue("Installation Directory") != null;
1010
}
1111
}

0 commit comments

Comments
 (0)