Resolve new NRE inspections

This commit is contained in:
Bartłomiej Dach
2020-12-01 22:39:04 +01:00
parent b236c75ac8
commit c9429632f4
2 changed files with 2 additions and 2 deletions

View File

@ -59,7 +59,7 @@ namespace osu.Desktop
try try
{ {
using (RegistryKey key = Registry.ClassesRoot.OpenSubKey("osu")) using (RegistryKey key = Registry.ClassesRoot.OpenSubKey("osu"))
stableInstallPath = key?.OpenSubKey(@"shell\open\command")?.GetValue(string.Empty).ToString()?.Split('"')[1].Replace("osu!.exe", ""); stableInstallPath = key?.OpenSubKey(@"shell\open\command")?.GetValue(string.Empty)?.ToString()?.Split('"')[1].Replace("osu!.exe", "");
if (checkExists(stableInstallPath)) if (checkExists(stableInstallPath))
return stableInstallPath; return stableInstallPath;

View File

@ -243,7 +243,7 @@ namespace osu.Game.Tournament.IPC
string stableInstallPath; string stableInstallPath;
using (RegistryKey key = Registry.ClassesRoot.OpenSubKey("osu")) using (RegistryKey key = Registry.ClassesRoot.OpenSubKey("osu"))
stableInstallPath = key?.OpenSubKey(@"shell\open\command")?.GetValue(string.Empty).ToString().Split('"')[1].Replace("osu!.exe", ""); stableInstallPath = key?.OpenSubKey(@"shell\open\command")?.GetValue(string.Empty)?.ToString()?.Split('"')[1].Replace("osu!.exe", "");
if (ipcFileExistsInDirectory(stableInstallPath)) if (ipcFileExistsInDirectory(stableInstallPath))
return stableInstallPath; return stableInstallPath;