dzwdz / chat_heads

Mozilla Public License 2.0
59 stars 34 forks source link

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

Closed Keksuccino closed 10 months ago

Keksuccino commented 10 months ago

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():

https://github.com/dzwdz/chat_heads/blob/c121d8a84540c4054f9fe0ddbc21c3415c9cb3d1/common/src/main/java/dzwdz/chat_heads/mixin/CommandSuggestionSuggestionsListMixin.java#L51 https://github.com/dzwdz/chat_heads/blob/c121d8a84540c4054f9fe0ddbc21c3415c9cb3d1/common/src/main/java/dzwdz/chat_heads/mixin/CommandSuggestionSuggestionsListMixin.java#L69

Thank you very much and have a great day!

Fourmisain commented 10 months ago

Fixed!

0.10.31 is out!

Keksuccino commented 10 months ago

Works great now, thank you very much!