From f8c53f03fdf7ba7ebe0591caf1e252693bd6af4f Mon Sep 17 00:00:00 2001 From: Evan Husted Date: Tue, 19 Nov 2024 10:22:11 -0600 Subject: [PATCH] Try and fix weird nullref --- src/Ryujinx.UI.Common/Helper/FileAssociationHelper.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Ryujinx.UI.Common/Helper/FileAssociationHelper.cs b/src/Ryujinx.UI.Common/Helper/FileAssociationHelper.cs index be10deca0..9333a1b76 100644 --- a/src/Ryujinx.UI.Common/Helper/FileAssociationHelper.cs +++ b/src/Ryujinx.UI.Common/Helper/FileAssociationHelper.cs @@ -101,13 +101,13 @@ namespace Ryujinx.UI.Common.Helper { RegistryKey key = Registry.CurrentUser.OpenSubKey(@$"Software\Classes\{ext}"); - if (key is null) + var openCmd = key?.OpenSubKey(@"shell\open\command"); + + if (openCmd is null) { return false; } - - var openCmd = key.OpenSubKey(@"shell\open\command"); - + string keyValue = (string)openCmd.GetValue(string.Empty); return keyValue is not null && (keyValue.Contains("Ryujinx") || keyValue.Contains(AppDomain.CurrentDomain.FriendlyName));