add target null check

This commit is contained in:
hirose 2019-12-26 19:10:41 +09:00
parent bfbf453b82
commit b7445b35e0
2 changed files with 2 additions and 2 deletions

View File

@ -52,7 +52,7 @@ namespace UniGLTF
{"gltf/bufferViews[]/target", "if(value.target!=0)" },
{"gltf/animations[]/channels[]/target", "if(value!=null)" },
{"gltf/accessors[]/sparse", "if(value.sparse!=null && value.sparse.count>0)"},
{"gltf/meshes[]/primitives[]/targets", "if(value.targets.Count>0)" },
{"gltf/meshes[]/primitives[]/targets", "if(value.targets!=null && value.targets.Count>0)" },
{"gltf/meshes[]/primitives[]/targets[]/POSITION", "if(value.POSITION!=-1)" },
{"gltf/meshes[]/primitives[]/targets[]/NORMAL", "if(value.NORMAL!=-1)" },

View File

@ -814,7 +814,7 @@ namespace UniGLTF {
f.Key("material"); f.GenSerialize(value.material);
}
if(value.targets.Count>0)
if(value.targets!=null && value.targets.Count>0)
{
f.Key("targets"); f.GenSerialize(value.targets);
}