TerraformersMC / ModMenu

A menu for, you guessed it, mods!
MIT License
508 stars 157 forks source link

Mod Menu icon crash (porting lib) #697

Open NolanHewitt opened 8 months ago

NolanHewitt commented 8 months ago

Going down to Porting Lib (from create patch f for fabric, 1.20.1) in Mod Menu crashes the game with the following error:

[02:24:49] [Render thread/ERROR]: Reported exception thrown! net.minecraft.ReportedException: Rendering screen at net.minecraft.client.renderer.GameRenderer.render(GameRenderer.java:954) ~[client-intermediary.jar:?] at net.minecraft.client.Minecraft.runTick(Minecraft.java:1219) ~[client-intermediary.jar:?] at net.minecraft.client.Minecraft.run(Minecraft.java:802) ~[client-intermediary.jar:?] at net.minecraft.client.main.Main.main(Main.java:250) ~[1.20.1-0.15.7.jar:?] at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:470) ~[fabric-loader-0.15.7.jar:?] at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74) ~[fabric-loader-0.15.7.jar:?] at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23) ~[fabric-loader-0.15.7.jar:?] Caused by: java.lang.NullPointerException: Mod icon for porting_lib is null somehow (should be filled with default in this case) at java.util.Objects.requireNonNull(Unknown Source) ~[?:?] at com.terraformersmc.modmenu.util.mod.fabric.FabricDummyParentMod.getIcon(FabricDummyParentMod.java:63) ~[modmenu-7.2.2.jar:?] at com.terraformersmc.modmenu.gui.widget.entries.ModListEntry.getIconTexture(ModListEntry.java:130) ~[modmenu-7.2.2.jar:?] at com.terraformersmc.modmenu.gui.widget.entries.ModListEntry.render(ModListEntry.java:59) ~[modmenu-7.2.2.jar:?] at com.terraformersmc.modmenu.gui.widget.entries.ParentEntry.render(ParentEntry.java:35) ~[modmenu-7.2.2.jar:?] at com.terraformersmc.modmenu.gui.widget.ModListWidget.renderList(ModListWidget.java:241) ~[modmenu-7.2.2.jar:?] at net.minecraft.client.gui.components.AbstractSelectionList.render(AbstractSelectionList.java:227) ~[client-intermediary.jar:?] at com.terraformersmc.modmenu.gui.ModsScreen.render(ModsScreen.java:285) ~[modmenu-7.2.2.jar:?] at net.minecraft.client.gui.screens.Screen.renderWithTooltip(Screen.java:110) ~[client-intermediary.jar:?] at net.minecraft.client.renderer.GameRenderer.mixinextras$bridge$method_47413$299(GameRenderer.java) ~[client-intermediary.jar:?] at net.minecraft.client.renderer.GameRenderer.wrapOperation$epl000$fancymenu$wrapRenderScreenFancyMenu(GameRenderer.java:8607) ~[client-intermediary.jar:?] at net.minecraft.client.renderer.GameRenderer.mixinextras$bridge$wrapOperation$epl000$fancymenu$wrapRenderScreenFancyMenu$300(GameRenderer.java) ~[client-intermediary.jar:?] at net.minecraft.client.renderer.GameRenderer.wrapOperation$gdc000$konkrete$wrapRenderScreenKonkrete(GameRenderer.java:12136) ~[client-intermediary.jar:?] at net.minecraft.client.renderer.GameRenderer.render(GameRenderer.java:945) ~[client-intermediary.jar:?] ... 6 more

McModknower commented 8 months ago

To me it looks like the null check from https://github.com/TerraformersMC/ModMenu/blob/8063aa363955a9fb12439512a9368e3f37ca2e58/src/main/java/com/terraformersmc/modmenu/util/mod/fabric/FabricMod.java#L162 should also be used in https://github.com/TerraformersMC/ModMenu/blob/8063aa363955a9fb12439512a9368e3f37ca2e58/src/main/java/com/terraformersmc/modmenu/util/mod/fabric/FabricDummyParentMod.java#L63

EmptyDreams commented 7 months ago

I also encountered this bug, and here is my crash log:

crash-2024-04-13_21.32.31-client.txt