소스 검색

Try and fix weird nullref

Evan Husted 1 년 전
부모
커밋
c3831428e0
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 4
      src/Ryujinx.UI.Common/Helper/FileAssociationHelper.cs

+ 4 - 4
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));