Skip to content

Account for empty variant arrays in parser#12

Open
Grimeh wants to merge 1 commit intoSixWays:masterfrom
Grimeh:fix/parse-empty-variant-arrays
Open

Account for empty variant arrays in parser#12
Grimeh wants to merge 1 commit intoSixWays:masterfrom
Grimeh:fix/parse-empty-variant-arrays

Conversation

@Grimeh
Copy link

@Grimeh Grimeh commented Jun 12, 2024

It's possible for entries in .shadervariants assets to have an empty variants array. Eg. variants: [].

This causes the parser to go out-of-bounds in the yaml list when the final entry has an empty variants array. When not the final entry, it probably causes the next entry to be parsed incorrectly.

Example of empty variant array:

  - first: {fileID: 4800000, guid: a5e0f9ecc5bd641c0b9a6c17fa79ded3, type: 3}
    second:
      variants: []

It's possible for entries in `.shadervariants` assets to have an empty variants array. Eg. `variants: []`.

This causes the parser to go out-of-bounds in the `yaml` list when the final entry has an empty variants array.
When not the final entry, it probably causes the next entry to be parsed incorrectly.
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