mirror of
https://git.mirrors.martin98.com/https://github.com/syoyo/tinygltf.git
synced 2025-08-13 19:25:52 +08:00
fix an issue when serializing an empty extension object would serialize as type null (and thus deserialize as type null, causing it to be ignored)
This commit is contained in:
parent
30bbe0fe3c
commit
db7f4e4d04
@ -4126,7 +4126,8 @@ static void SerializeExtensionMap(ExtensionMap &extensions, json &o) {
|
||||
json ret;
|
||||
if (ValueToJson(extIt->second, &ret)) {
|
||||
extMap[extIt->first] = ret;
|
||||
} else {
|
||||
}
|
||||
if(ret.is_null()) {
|
||||
if (!(extIt->first.empty())) { // name should not be empty, but for sure
|
||||
// create empty object so that an extension name is still included in json.
|
||||
extMap[extIt->first] = json({});
|
||||
|
Loading…
x
Reference in New Issue
Block a user