SomeSourceCode / SomeGuiApi

A Paper API to create interactable GUIs using Minecraft Inventories, ...
MIT License
1 stars 0 forks source link

NullPointerException when root is null #8

Closed SomeSourceCode closed 3 months ago

SomeSourceCode commented 3 months ago

Description

When the scene root is set to null, rendering the GUI throws a NullPointerException.

Potential Fix

This is because ChestGui#render() method doesn't return after checking whether the root is null.

https://github.com/SomeSourceCode/SomeGuiApi/blob/b8a1802e3f2667fba55dbdab64c4a756a1e34626/src/main/java/io/github/somesourcecode/someguiapi/scene/gui/ChestGui.java#L108-L113

In this code snippet the method doesn't return if the root is null. When fixing this, note that the method needs to return when the root is null regardless of what the background is.