Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix possible NullPointerException trying to draw tooltip icons #34

Merged
merged 1 commit into from Jun 13, 2021

Conversation

Fourmisain
Copy link
Contributor

When using Show Off with an enchanted book, holding shift to show the tooltip icons (or having them set to always draw) will crash the game on mouse-over.

This comes back to the general issue of enchantedItemStack not always being set and cachedTooltipIcons will return null, thus producing a NPE.
Since this general issue is hard to fix, I retorted to the simple fix of skipping the whole method.

I should also say that since cachedTooltipIcons is a WeakHashMap, get can always return null, so this might fix some crashes in low memory situations as well.

@Bernasss12 Bernasss12 merged commit f2748ac into Bernasss12:mc-1.16.4 Jun 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants