Chat Heads

Chat Heads

35M Downloads

Check if `Minecraft#getConnection()` is NULL before using it in `CommandSuggestionSuggestionsListMixin`

Keksuccino opened this issue · 2 comments

commented

Hi, dev of FancyMenu here!

One of my users reported a crash related to our mods and it happens because I use suggestion lists for text input boxes in other parts of GUIs (also when no world/server is loaded).
Since you call Minecraft#getConnection() in CommandSuggestionSuggestionsListMixin, the game will crash when the player is not in a world/server.

Please add NULL checks for both calls to Minecraft#getConnection():

PlayerInfo playerInfo = Minecraft.getInstance().getConnection().getPlayerInfo(suggestionList.get(i).getText());

chatheads$player = Minecraft.getInstance().getConnection().getPlayerInfo(suggestion.getText());

Thank you very much and have a great day!

commented

Fixed!

0.10.31 is out!

commented

Works great now, thank you very much!