mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-10-09 16:48:52 +02:00
misc: chore: Fix numerous NullReferenceExceptions, InvalidOperationExceptions
This commit is contained in:
@@ -388,7 +388,12 @@ namespace Ryujinx.Cpu.Jit.HostTracked
|
||||
_treeLock.ExitReadLock();
|
||||
}
|
||||
|
||||
return (_backingMemory, _firstPagePa.Value);
|
||||
if (_firstPagePa != null)
|
||||
{
|
||||
return (_backingMemory, _firstPagePa.Value);
|
||||
}
|
||||
|
||||
return (null, 0);
|
||||
}
|
||||
|
||||
public PrivateRange GetPrivateAllocation(ulong va)
|
||||
|
||||
@@ -135,7 +135,10 @@ namespace Ryujinx.Cpu.Jit
|
||||
offset += (int)copySize;
|
||||
}
|
||||
|
||||
return new ReadOnlySequence<byte>(first, 0, last, (int)(size - last.RunningIndex));
|
||||
if (last != null)
|
||||
{
|
||||
return new ReadOnlySequence<byte>(first, 0, last, (int)(size - last.RunningIndex));
|
||||
}
|
||||
}
|
||||
catch (InvalidMemoryRegionException)
|
||||
{
|
||||
@@ -146,6 +149,8 @@ namespace Ryujinx.Cpu.Jit
|
||||
|
||||
return ReadOnlySequence<byte>.Empty;
|
||||
}
|
||||
|
||||
return default;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
||||
Reference in New Issue
Block a user