mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-10-06 11:58:52 +02:00
misc: chore: Fix possible NullReferenceExceptions, InvalidOperationExceptions
This commit is contained in:
@@ -58,7 +58,7 @@ namespace Ryujinx.HLE.Debugger
|
||||
internal KProcess Process => Device.System?.DebugGetApplicationProcess();
|
||||
internal IDebuggableProcess DebugProcess => Device.System?.DebugGetApplicationProcessDebugInterface();
|
||||
private KThread[] GetThreads() => DebugProcess.GetThreadUids().Select(x => DebugProcess.GetThread(x)).ToArray();
|
||||
internal bool IsProcessAarch32 => DebugProcess.GetThread(gThread.Value).Context.IsAarch32;
|
||||
internal bool IsProcessAarch32 => gThread != null && DebugProcess.GetThread(gThread.Value).Context.IsAarch32;
|
||||
private KernelContext KernelContext => Device.System.KernelContext;
|
||||
|
||||
const int GdbRegisterCount64 = 68;
|
||||
|
||||
+1
-1
@@ -1099,7 +1099,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator
|
||||
}
|
||||
if (!IPAddress.TryParse(ldnServer, out IPAddress ipAddress))
|
||||
{
|
||||
ipAddress = Dns.GetHostEntry(ldnServer).AddressList[0];
|
||||
ipAddress = Dns.GetHostEntry(ldnServer ?? string.Empty).AddressList[0];
|
||||
}
|
||||
NetworkClient = new LdnMasterProxyClient(ipAddress.ToString(), LanPlayPort, context.Device.Configuration);
|
||||
}
|
||||
|
||||
@@ -267,7 +267,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy
|
||||
// Attempt to find matching configuration. If we don't find one, wait for a bit and try again.
|
||||
// Woken by new tokens coming in from the master server.
|
||||
|
||||
IPAddress address = (session.Socket.RemoteEndPoint as IPEndPoint).Address;
|
||||
IPAddress address = (session.Socket.RemoteEndPoint as IPEndPoint)?.Address;
|
||||
byte[] addressBytes = ProxyHelpers.AddressTo16Byte(address);
|
||||
|
||||
long time;
|
||||
@@ -282,7 +282,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy
|
||||
// Allow any client that has a private IP to connect. (indicated by the server as all 0 in the token)
|
||||
|
||||
bool isPrivate = waitToken.PhysicalIp.AsSpan().SequenceEqual(new byte[16]);
|
||||
bool ipEqual = isPrivate || waitToken.AddressFamily == address.AddressFamily && waitToken.PhysicalIp.AsSpan().SequenceEqual(addressBytes);
|
||||
bool ipEqual = address != null && (isPrivate || waitToken.AddressFamily == address.AddressFamily && waitToken.PhysicalIp.AsSpan().SequenceEqual(addressBytes));
|
||||
|
||||
if (ipEqual && waitToken.Token.AsSpan().SequenceEqual(config.Token.AsSpan()))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user