From 387d9e20f4e29d0e976cc35470b432a6ecaaa9cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Hamil?= Date: Sun, 4 Aug 2024 12:46:04 +0300 Subject: [PATCH] fix:HLE/ModLoader: Cheat loading crashes if directory doesn't exist --- src/Ryujinx.HLE/HOS/ModLoader.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Ryujinx.HLE/HOS/ModLoader.cs b/src/Ryujinx.HLE/HOS/ModLoader.cs index ee179c929..32566dc70 100644 --- a/src/Ryujinx.HLE/HOS/ModLoader.cs +++ b/src/Ryujinx.HLE/HOS/ModLoader.cs @@ -741,6 +741,11 @@ namespace Ryujinx.HLE.HOS internal static void EnableCheats(ulong applicationId, TamperMachine tamperMachine) { var contentDirectory = FindApplicationDir(new DirectoryInfo(Path.Combine(GetModsBasePath(), AmsContentsDir)), $"{applicationId:x16}"); + if (contentDirectory == null) + { + return; + } + string enabledCheatsPath = Path.Combine(contentDirectory.FullName, CheatDir, "enabled.txt"); if (File.Exists(enabledCheatsPath))