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

Handle dispatch codec receiving null decoders more gracefully #87

Open ThatGravyBoat opened 9 months ago

ThatGravyBoat commented 9 months ago

The KeyDispatchCodec assumes that a decoder can never be null when received as such it causes an npe when trying to use it. This PR changes it so that the dispatch methods on the Codec class now check if the Codec returned is null and returns an appropriate DataResult error and the decoder call in KeyDispatchCodec gives a generic DataResult error