mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-10-05 23:08:52 +02:00
misc: chore: Fix numerous NullReferenceExceptions, InvalidOperationExceptions
This commit is contained in:
@@ -318,13 +318,16 @@ namespace Ryujinx.Common.Collections
|
||||
{
|
||||
Root = newNode;
|
||||
}
|
||||
else if (start.CompareTo(parent.Start) < 0)
|
||||
else if (parent != null && start.CompareTo(parent.Start) < 0)
|
||||
{
|
||||
parent.Left = newNode;
|
||||
}
|
||||
else
|
||||
{
|
||||
parent.Right = newNode;
|
||||
if (parent != null)
|
||||
{
|
||||
parent.Right = newNode;
|
||||
}
|
||||
}
|
||||
|
||||
PropagateIncrease(newNode);
|
||||
|
||||
@@ -279,13 +279,16 @@ namespace Ryujinx.Common.Collections
|
||||
{
|
||||
Root = newNode;
|
||||
}
|
||||
else if (key.CompareTo(parent.Key) < 0)
|
||||
else if (parent != null && key.CompareTo(parent.Key) < 0)
|
||||
{
|
||||
parent.Left = newNode;
|
||||
}
|
||||
else
|
||||
{
|
||||
parent.Right = newNode;
|
||||
if (parent != null)
|
||||
{
|
||||
parent.Right = newNode;
|
||||
}
|
||||
}
|
||||
Count++;
|
||||
return newNode;
|
||||
|
||||
@@ -273,7 +273,7 @@ namespace Ryujinx.Common.Configuration
|
||||
{
|
||||
FileSystemInfo resolvedDirectoryInfo =
|
||||
Directory.ResolveLinkTarget(correctApplicationDataDirectoryPath, true);
|
||||
string resolvedPath = resolvedDirectoryInfo.FullName;
|
||||
string resolvedPath = resolvedDirectoryInfo?.FullName;
|
||||
Logger.Error?.Print(LogClass.Application, $"Please manually move your Ryujinx data from {resolvedPath} to {correctApplicationDataDirectoryPath}, and remove the symlink.");
|
||||
}
|
||||
catch (Exception symlinkException)
|
||||
@@ -297,7 +297,7 @@ namespace Ryujinx.Common.Configuration
|
||||
{
|
||||
FileSystemInfo resolvedDirectoryInfo =
|
||||
Directory.ResolveLinkTarget(correctApplicationDataDirectoryPath, true);
|
||||
string resolvedPath = resolvedDirectoryInfo.FullName;
|
||||
string resolvedPath = resolvedDirectoryInfo?.FullName;
|
||||
Logger.Error?.Print(LogClass.Application, $"Please manually move your Ryujinx data from {resolvedPath} to {correctApplicationDataDirectoryPath}, and remove the symlink.");
|
||||
}
|
||||
catch (Exception symlinkException)
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ namespace Ryujinx.Common.Configuration.Hid.Controller.Motion
|
||||
{
|
||||
string propertyName = tempReader.GetString();
|
||||
|
||||
if (propertyName.Equals("motion_backend"))
|
||||
if (propertyName is "motion_backend")
|
||||
{
|
||||
tempReader.Read();
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Ryujinx.Common.Configuration.Hid
|
||||
{
|
||||
string propertyName = tempReader.GetString();
|
||||
|
||||
if (propertyName.Equals("backend"))
|
||||
if (propertyName is "backend")
|
||||
{
|
||||
tempReader.Read();
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Ryujinx.Common.Logging
|
||||
public readonly struct Log
|
||||
{
|
||||
private static readonly string _homeDir = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
|
||||
private static readonly string _homeDirRedacted = Path.Combine(Directory.GetParent(_homeDir).FullName, "[redacted]");
|
||||
private static readonly string _homeDirRedacted = Path.Combine(Directory.GetParent(_homeDir)?.FullName ?? string.Empty, "[redacted]");
|
||||
|
||||
internal readonly LogLevel Level;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user