Mojang / DataFixerUpper

A set of utilities designed for incremental building, merging and optimization of data transformations.
MIT License
1.2k stars 138 forks source link

Trying to update with no registered fixers causes NPE #43

Open i509VCB opened 5 years ago

i509VCB commented 5 years ago

So I was toying around with DFU and I discovered a bug while playing with Schemas to register my type references.

So if you create a DataFixer through the DataFixerBuilder and don't add a DataFix to any registered schema version (adding a DataFix to any schema fixes the issue), when you build and then update a Dynamic through the update method, you get an NPE from the DataFixer inside of private int getLowestFixSameVersion(final int versionKey) within DataFixerUpper at Line 115 where it checks for fixerVersions.

The intended functionality I thought would occur is the DFU would just pass out the Dynamic unchanged because there are no fixes at all to modify the Dynamic with, however the update seems to attempt to fix the data even if there are not any fixes to actually apply.

Sorry about the horrible wording it is about 10:45 at night here. Just ask me if you need any clarification about any more explanation.