From 2c66f01cbb2968dad3149f85dfdb0bef658b987f Mon Sep 17 00:00:00 2001 From: VictoriousRaptor <10308169+VictoriousRaptor@users.noreply.github.com> Date: Wed, 16 Oct 2024 11:09:17 +0800 Subject: [PATCH] Null check when reading regkey --- Flow.Launcher/Helper/WindowsMediaPlayerHelper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flow.Launcher/Helper/WindowsMediaPlayerHelper.cs b/Flow.Launcher/Helper/WindowsMediaPlayerHelper.cs index 2eec6c89b08..9d2046972eb 100644 --- a/Flow.Launcher/Helper/WindowsMediaPlayerHelper.cs +++ b/Flow.Launcher/Helper/WindowsMediaPlayerHelper.cs @@ -6,6 +6,6 @@ internal static class WindowsMediaPlayerHelper internal static bool IsWindowsMediaPlayerInstalled() { using var key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\MediaPlayer"); - return key.GetValue("Installation Directory") != null; + return key?.GetValue("Installation Directory") != null; } }