cheahjs / palworld-save-tools

Tools for converting Palworld .sav files to JSON and back
MIT License
766 stars 64 forks source link

Fix no custom properties when set to "all" bug #146

Closed xNul closed 4 months ago

xNul commented 4 months ago

The if statement branch is never taken in this scenario because the length of custom_properties will always be zero. Meaning, anyone using this function directly will never be able to use the default "all" value for custom_properties_keys.

It seems to be a small typo and the intention was to ensure the custom_properties_keys list has at least one element in it before indexing to avoid a potential runtime error.

I've made the small fix here, if you would like to merge it.

cheahjs commented 4 months ago

Whoops, thanks for catching this.