Skip to content

Commit

Permalink
Try and fix weird nullref
Browse files Browse the repository at this point in the history
  • Loading branch information
GreemDev committed Nov 19, 2024
1 parent fda79ef commit f8c53f0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Ryujinx.UI.Common/Helper/FileAssociationHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ static bool CheckRegistering(string ext)
{
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));
Expand Down

0 comments on commit f8c53f0

Please sign in to comment.