misc: chore: Fix possible NullReferenceExceptions, suppress warnings

This commit is contained in:
KeatonTheBot
2025-12-13 13:32:49 -06:00
parent 9920619ff6
commit c70f692324
29 changed files with 100 additions and 80 deletions
+2 -2
View File
@@ -173,7 +173,7 @@ namespace Ryujinx.HLE.HOS
types.Clear();
Mod<DirectoryInfo> mod = new("", null, true);
if (StrEquals(RomfsDir, modDir.Name))
if (StrEquals(RomfsDir, modDir.Name) && modDir.Parent != null)
{
var modData = modMetadata.Mods.FirstOrDefault(x => modDir.Parent.FullName.Equals(x.Path));
var enabled = modData?.Enabled ?? true;
@@ -181,7 +181,7 @@ namespace Ryujinx.HLE.HOS
mods.RomfsDirs.Add(mod = new Mod<DirectoryInfo>(dir.Name, modDir, enabled));
types.Append('R');
}
else if (StrEquals(ExefsDir, modDir.Name))
else if (StrEquals(ExefsDir, modDir.Name) && modDir.Parent != null)
{
var modData = modMetadata.Mods.FirstOrDefault(x => modDir.Parent.FullName.Equals(x.Path));
var enabled = modData?.Enabled ?? true;