mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-11-20 01:21:15 +01:00
misc: chore: Fix possible NullReferenceExceptions, suppress warnings
This commit is contained in:
1 parent
9063b4b8db
commit
fe7b601826
29 files changed
+100
-80
No files matched your search
@@ -64,7 +64,7 @@ namespace Ryujinx.Horizon.Sdk.Friends.Detail.Ipc
|
||||
{
|
||||
lock (_lock)
|
||||
{
|
||||
if (_notifications.Count >= 1)
|
||||
if (_notifications.Count >= 1 && _notifications.First != null)
|
||||
{
|
||||
sizedNotificationInfo = _notifications.First.Value;
|
||||
_notifications.RemoveFirst();
|
||||
@@ -97,7 +97,7 @@ namespace Ryujinx.Horizon.Sdk.Friends.Detail.Ipc
|
||||
{
|
||||
SizedNotificationInfo friendListNotification = new();
|
||||
|
||||
if (_notifications.Count != 0)
|
||||
if (_notifications.Count != 0 && _notifications.First != null)
|
||||
{
|
||||
friendListNotification = _notifications.First.Value;
|
||||
_notifications.RemoveFirst();
|
||||
@@ -110,7 +110,7 @@ namespace Ryujinx.Horizon.Sdk.Friends.Detail.Ipc
|
||||
{
|
||||
SizedNotificationInfo newFriendRequestNotification = new();
|
||||
|
||||
if (_notifications.Count != 0)
|
||||
if (_notifications.Count != 0 && _notifications.First != null)
|
||||
{
|
||||
newFriendRequestNotification = _notifications.First.Value;
|
||||
_notifications.RemoveFirst();
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace Ryujinx.Horizon.Sdk.Sf.Cmif
|
||||
return null;
|
||||
}
|
||||
|
||||
var entry = _freeList.First.Value;
|
||||
var entry = _freeList.First?.Value;
|
||||
_freeList.RemoveFirst();
|
||||
return entry;
|
||||
}
|
||||
@@ -117,11 +117,9 @@ namespace Ryujinx.Horizon.Sdk.Sf.Cmif
|
||||
public override void RegisterObject(int id, ServiceObjectHolder obj)
|
||||
{
|
||||
var entry = _manager._entryManager.GetEntry(id);
|
||||
DebugUtil.Assert(entry != null);
|
||||
|
||||
lock (_manager._entryOwnerLock)
|
||||
{
|
||||
DebugUtil.Assert(entry.Owner == null);
|
||||
entry.Owner = this;
|
||||
entry.Node = _entries.AddLast(entry);
|
||||
}
|
||||
@@ -188,9 +186,6 @@ namespace Ryujinx.Horizon.Sdk.Sf.Cmif
|
||||
{
|
||||
var entry = _manager._entryManager.GetEntry(ids[i]);
|
||||
|
||||
DebugUtil.Assert(entry != null);
|
||||
DebugUtil.Assert(entry.Owner == null);
|
||||
|
||||
_manager._entryManager.FreeEntry(entry);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user