diff --git a/ModEntry.cs b/ModEntry.cs index 5612e0a..18920f4 100644 --- a/ModEntry.cs +++ b/ModEntry.cs @@ -128,10 +128,15 @@ public override void Entry(IModHelper helper) postfix: new HarmonyMethod(typeof(ObjectPatches), nameof(ObjectPatches.InventoryMenu_draw_Postfix)) ); - harmony.Patch( - original: AccessTools.Method(typeof(SeedShop), nameof(SeedShop.draw)), - prefix: new HarmonyMethod(typeof(ObjectPatches), nameof(ObjectPatches.SeedShop_draw_Prefix)) - ); + var seedShopDraw = AccessTools.Method(typeof(SeedShop), nameof(SeedShop.draw)); + if (seedShopDraw != null) { + harmony.Patch( + original: seedShopDraw, + prefix: new HarmonyMethod(typeof(ObjectPatches), nameof(ObjectPatches.SeedShop_draw_Prefix)) + ); + } else { + SMonitor.Log("SeedShop.draw method not found on this platform. SeedShop draw patch will not be applied.", LogLevel.Warn); + } harmony.Patch( original: AccessTools.Method(typeof(GameLocation), nameof(GameLocation.performAction), new Type[] { typeof(string[]), typeof(Farmer), typeof(Location) }),