1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 14:47:25 +08:00

Fix InspectCode warnings

This commit is contained in:
Roman Kapustin 2020-11-21 02:06:20 +03:00
parent 7435416497
commit 1feda1152d
3 changed files with 7 additions and 2 deletions

View File

@ -79,7 +79,7 @@ namespace osu.Desktop
private string getStableInstallPathFromRegistry()
{
using (RegistryKey key = Registry.ClassesRoot.OpenSubKey("osu"))
return key?.OpenSubKey(@"shell\open\command")?.GetValue(string.Empty).ToString()?.Split('"')[1].Replace("osu!.exe", "");
return key?.OpenSubKey(@"shell\open\command")?.GetValue(string.Empty)?.ToString()?.Split('"')[1].Replace("osu!.exe", "");
}
protected override UpdateManager CreateUpdateManager()

View File

@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Diagnostics;
using System.Linq;
using NUnit.Framework;
using osu.Framework.Allocation;
@ -73,6 +74,8 @@ namespace osu.Game.Tests.Visual.Gameplay
switch (args.Action)
{
case NotifyCollectionChangedAction.Add:
Debug.Assert(args.NewItems != null, "args.NewItems != null");
foreach (int user in args.NewItems)
{
if (user == api.LocalUser.Value.Id)
@ -82,6 +85,8 @@ namespace osu.Game.Tests.Visual.Gameplay
break;
case NotifyCollectionChangedAction.Remove:
Debug.Assert(args.OldItems != null, "args.OldItems != null");
foreach (int user in args.OldItems)
{
if (user == api.LocalUser.Value.Id)

View File

@ -243,7 +243,7 @@ namespace osu.Game.Tournament.IPC
string stableInstallPath;
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))
return stableInstallPath;