check index range

This commit is contained in:
G21
2018-04-07 17:30:07 +09:00
parent 789b9b73e5
commit 2e46b80a4a

View File

@@ -45,7 +45,7 @@ namespace VRM
meta.ContactInformation = gltfMeta.contactInformation;
meta.Reference = gltfMeta.reference;
meta.Title = gltfMeta.title;
if (gltfMeta.texture != -1)
if (gltfMeta.texture >=0 && gltfMeta.texture< Textures.Count)
{
meta.Thumbnail = Textures[gltfMeta.texture].Texture;
}