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 potential NPE when calling ItemMobSpawner#loadSpawners. #405

Merged
merged 1 commit into from
Jul 16, 2023

Conversation

wlhlm
Copy link
Member

@wlhlm wlhlm commented Jul 16, 2023

ItemMobSpawner#loadSpawners is static and might access IDtoNameMap before it is initialized in the constructor.

Copy link
Member

@eigenraven eigenraven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a point to keeping the assignment in the constructor at all? These are private, so maybe making them final too would be fine.

@wlhlm
Copy link
Member Author

wlhlm commented Jul 16, 2023

Good point. I was under the assumption that the code relied on these maps being reset when calling the constructor, but after rechecking, it doesn't seem to be the case actually.

@wlhlm wlhlm merged commit 5b9c27e into master Jul 16, 2023
1 check passed
@wlhlm wlhlm deleted the mob-spawner-npe branch July 16, 2023 12:29
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.

2 participants