Skip to content
This repository was archived by the owner on Nov 7, 2023. It is now read-only.

removes dependency on server world name leading to NPE; fixes #247#249

Open
dzrw wants to merge 1 commit intoChicken-Bones:1.7from
dzrw:1.7
Open

removes dependency on server world name leading to NPE; fixes #247#249
dzrw wants to merge 1 commit intoChicken-Bones:1.7from
dzrw:1.7

Conversation

@dzrw
Copy link

@dzrw dzrw commented Jul 27, 2015

It is possible to construct a server's world name in such a way as to cause NEIClientConfig.loadWorld to raise an IOException and leave the world variable set to null. Unfortunately, the loadWorld callsite is wrapped in a catch-and-swallow style exception handler which causes the world != null invariant to be violated; the bug is ultimately revealed as an NPE during renderSlotOverlay.

For example, the server-sent world name ../../var/lib/minecraft/world results in a malformed saves/NEI folder that lacks a remote/HOST~PORT folder.

The fix is to remove this dependency on the server world name, and use a hard-coded name instead. This ought to be safe because a HOST:PORT combination should uniquely identify a world, but this assumption should be reviewed.

I've also added some logging around the assignment of the world variable, so that it will log a more helpful error message if NEI is unable to create this variable in the future for some other reason.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments