mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-10-05 18:18:55 +02:00
misc: Tweak NullReferenceException fixes
This commit is contained in:
@@ -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.");
|
||||
|
||||
Reference in New Issue
Block a user