From 1b1efbce6d510aa695770ffe3098187747dfed7b Mon Sep 17 00:00:00 2001 From: Guus Waals <_@guusw.nl> Date: Fri, 17 Jan 2025 03:33:25 +0800 Subject: [PATCH] Fix material selection panel --- mod/Patches/MaterialSelectionPanel.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mod/Patches/MaterialSelectionPanel.cs b/mod/Patches/MaterialSelectionPanel.cs index 592078a..766d00c 100644 --- a/mod/Patches/MaterialSelectionPanel.cs +++ b/mod/Patches/MaterialSelectionPanel.cs @@ -7,8 +7,14 @@ namespace PriorityUX { [HarmonyPatch(nameof(MaterialSelectionPanel.RefreshSelectors))] [HarmonyPostfix] static void RefreshSelectorsPostfix(PriorityScreen ___priorityScreen) { + if (___priorityScreen == null) { + Debug.Log("RefreshSelectors ___priorityScreen is null"); + return; + } Debug.Log("RefreshSelectors"); - Debug.Log("___priorityScreen.gameObject.activeSelf: " + ___priorityScreen.gameObject.activeSelf); + if (___priorityScreen.gameObject != null) { + Debug.Log("___priorityScreen.gameObject.activeSelf: " + ___priorityScreen.gameObject.activeSelf); + } // if (___priorityScreen.gameObject.activeSelf) Utils.refreshPriorityScreen(___priorityScreen); }