diff --git a/Source/AkiSupport/Singleplayer/Patches/Progression/MidRaidQuestChangePatch.cs b/Source/AkiSupport/Singleplayer/Patches/Progression/MidRaidQuestChangePatch.cs index 1a81ad88..fa24bf0b 100644 --- a/Source/AkiSupport/Singleplayer/Patches/Progression/MidRaidQuestChangePatch.cs +++ b/Source/AkiSupport/Singleplayer/Patches/Progression/MidRaidQuestChangePatch.cs @@ -25,8 +25,9 @@ protected override MethodBase GetTargetMethod() [PatchPostfix] private static void PatchPostfix() { + Logger.LogDebug($"[MidRaidQuestChangePatch] PatchPostfix"); var gameWorld = Singleton.Instance; - if (gameWorld != null) + if (gameWorld == null) { Logger.LogError($"[MidRaidQuestChangePatch] gameWorld instance was null"); @@ -34,15 +35,18 @@ private static void PatchPostfix() } var player = gameWorld.MainPlayer; - Logger.LogDebug($"[MidRaidQuestChangePatch] PatchPostfix"); var questController = (QuestController)ReflectionHelpers.GetFieldFromType(player.GetType(), "_questController").GetValue(player); - if (questController != null) + if (questController == null) + { + Logger.LogError($"[MidRaidQuestChangePatch] questController instance was null"); + + return; + } + + foreach (var quest in questController.Quests.ToList()) { - foreach (var quest in questController.Quests.ToList()) - { - quest.CheckForStatusChange(true, true); - } + quest.CheckForStatusChange(true, true); } } }