Add Safety Checks and Exception Handling to Game Patches

This commit is contained in:
copecone committed 2026-08-08 22:54:31 +09:00
1 parent 85871332d5
commit cb0d9c1c9c
4 files changed
+17 -1

No files matched your search

+6
View File
@@ -1,5 +1,6 @@
using ADOFAIRenderer.Core;
using HarmonyLib;
using MelonLoader;
using UnityEngine;
using UnityEngine.UI;
@@ -15,6 +16,11 @@ namespace ADOFAIRenderer.Patch.Game
public static void AddButtonRender(scnEditor __instance)
{
if (RenderMod.IsFeatureDisabled) return;
if (!__instance || !__instance.buttonExit)
{
Melon<RenderMod>.Logger.Msg("scnEditor에 렌더 버튼을 만들 수 없습니다.");
return;
}
var cloneTarget = __instance.buttonExit!.gameObject;
var buttonContainer = cloneTarget.transform.parent!;