misc: Tweak NullReferenceException fixes

This commit is contained in:
KeatonTheBot
2025-10-31 01:04:00 -05:00
parent e3ee28605d
commit a6c0eabf49
23 changed files with 143 additions and 128 deletions
@@ -60,12 +60,9 @@ namespace Ryujinx.HLE.HOS.Kernel.Ipc
KernelContext.CriticalSection.Enter();
if (list.Count != 0)
if (list.Count != 0 && list.First != null)
{
if (list.First != null)
{
session = list.First.Value;
}
session = list.First.Value;
list.RemoveFirst();
}
@@ -32,13 +32,10 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory
public ref T GetRef<T>(ulong offset) where T : unmanaged
{
if (_pageList.Nodes.Count == 1)
if (_pageList.Nodes.Count == 1 && _pageList.Nodes.First != null)
{
if (_pageList.Nodes.First != null)
{
ulong address = _pageList.Nodes.First.Value.Address - DramMemoryMap.DramBase;
return ref _context.Memory.GetRef<T>(address + offset);
}
ulong address = _pageList.Nodes.First.Value.Address - DramMemoryMap.DramBase;
return ref _context.Memory.GetRef<T>(address + offset);
}
throw new NotImplementedException("Non-contiguous shared memory is not yet supported.");