Some names in glTF data structures are required and some are optional.
We normally ensure that names that are required can't be NULL as a byproduct of how they are parsed: required names usually come up when they are JSON object keys, so a lack of a name means the object isn't parsed.
Material variants are an odd exception: the name is required (in fact it's the only thing that a variant has...), but it's stored as a "name" key in an array of objects because the extension needs to maintain variant order. It's natural for the user to assume that the name is not NULL as the spec requires that, but it can be NULL in non-compliant documents, so we validate this now.
Some names in glTF data structures are required and some are optional.
We normally ensure that names that are required can't be NULL as a byproduct of how they are parsed: required names usually come up when they are JSON object keys, so a lack of a name means the object isn't parsed.
Material variants are an odd exception: the name is required (in fact it's the only thing that a variant has...), but it's stored as a "name" key in an array of objects because the extension needs to maintain variant order. It's natural for the user to assume that the name is not NULL as the spec requires that, but it can be NULL in non-compliant documents, so we validate this now.