mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-10-09 19:28:53 +02:00
misc: chore: Fix possible NullReferenceExceptions, suppress warnings
This commit is contained in:
@@ -190,7 +190,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd.Impl
|
||||
{
|
||||
Socket.Listen(backlog);
|
||||
|
||||
Logger.Info?.PrintMsg(LogClass.ServiceBsd, $"Socket listening: {ProtocolType}/{(Socket.LocalEndPoint as IPEndPoint).Port}");
|
||||
Logger.Info?.PrintMsg(LogClass.ServiceBsd, $"Socket listening: {ProtocolType}/{((IPEndPoint)Socket.LocalEndPoint).Port}");
|
||||
|
||||
return LinuxError.SUCCESS;
|
||||
}
|
||||
@@ -573,7 +573,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd.Impl
|
||||
|
||||
try
|
||||
{
|
||||
int receiveSize = (Socket as DefaultSocket).BaseSocket.Receive(ConvertMessagesToBuffer(message), ConvertBsdSocketFlags(flags), out SocketError socketError);
|
||||
int receiveSize = ((DefaultSocket)Socket).BaseSocket.Receive(ConvertMessagesToBuffer(message), ConvertBsdSocketFlags(flags), out SocketError socketError);
|
||||
|
||||
if (receiveSize > 0)
|
||||
{
|
||||
@@ -615,7 +615,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd.Impl
|
||||
|
||||
try
|
||||
{
|
||||
int sendSize = (Socket as DefaultSocket).BaseSocket.Send(ConvertMessagesToBuffer(message), ConvertBsdSocketFlags(flags), out SocketError socketError);
|
||||
int sendSize = ((DefaultSocket)Socket).BaseSocket.Send(ConvertMessagesToBuffer(message), ConvertBsdSocketFlags(flags), out SocketError socketError);
|
||||
|
||||
if (sendSize > 0)
|
||||
{
|
||||
|
||||
@@ -56,6 +56,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd.Types
|
||||
{
|
||||
for (int index = 0; index < iovCount; index++)
|
||||
{
|
||||
if (message.Iov == null) continue;
|
||||
ulong iovLength = (ulong)message.Iov[index].Length;
|
||||
|
||||
if (!MemoryMarshal.TryWrite(rawData, in iovLength))
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Nsd
|
||||
NsdSettings = new NsdSettings
|
||||
{
|
||||
Initialized = true,
|
||||
TestMode = (bool)testMode,
|
||||
TestMode = (bool)testMode!,
|
||||
Environment = (string)environmentIdentifier,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user