FoundationGames / Automobility

A Minecraft mod on the Fabric modloader which aims to add some useful vehicles.
MIT License
54 stars 33 forks source link

Forge 1.19.2: crash when selecting an empty recipe type. #56

Open NordicNooob opened 1 year ago

NordicNooob commented 1 year ago

Running the latest version, 0.4.1.

If all recipes of a specific category (in my case, engines) are removed from the auto mechanic table, the list is not detected as empty and will crash upon trying to display the empty list of items.

Otherwise potentially notable is that I used CraftTweaker to remove the aforementioned engine recipes, but this issue seems to simply because there are no recipes there, not that it was specifically crafttweaker that removed them.

Here's the relevant line of the crash report. ` Description: Rendering screen

java.lang.NullPointerException: Cannot invoke "java.util.List.size()" because "recipes" is null at io.github.foundationgames.automobility.screen.AutoMechanicTableScreen.drawRecipes(AutoMechanicTableScreen.java:302) ~[automobility-0.4.1+1.19.2-forge.jar%23257!/:?] {re:classloading} at io.github.foundationgames.automobility.screen.AutoMechanicTableScreen.m7286(AutoMechanicTableScreen.java:128) ~[automobility-0.4.1+1.19.2-forge.jar%23257!/:?] {re:classloading} at net.minecraft.client.gui.screens.inventory.AbstractContainerScreen.m6305(AbstractContainerScreen.java:92) ~[client-1.19.2-20220805.130853-srg.jar%23347!/:?] `