Skip to content

Fixed crash on 1.21.1 when a placed feature is null.#1166

Open
IkeVoodoo wants to merge 2 commits into
DynamicTreesTeam:release/1.21.1from
IkeVoodoo:develop/1.21.1
Open

Fixed crash on 1.21.1 when a placed feature is null.#1166
IkeVoodoo wants to merge 2 commits into
DynamicTreesTeam:release/1.21.1from
IkeVoodoo:develop/1.21.1

Conversation

@IkeVoodoo
Copy link
Copy Markdown

If a mod creates a PlacedFeature which either:

  1. Throws an NPE on PlacedFeature#getFeatures()
  2. Returns null from PlacedFeature#getFeatures()
  3. Returns one or more null configs from PlacedFeature#getFeatures()
  4. Throws an NPE from FeatureCanceller#shouldCancel()

Then it would crash world generation. Instead, I added guards check for the first two issues, and for the remaining ones I wrapped in a try-catch block as that is outside the mod's control.

I would like to ask how I can better log the errors though, as right now they're silently swallowed. I didn't yet write the fix for other versions.

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.

1 participant