Browse Source

added extra check for AOT cases

vpenades 1 year ago
parent
commit
30a9d83c26

+ 1 - 0
src/SharpGLTF.Toolkit/Geometry/VertexTypes/VertexUtils.Accessors.cs

@@ -47,6 +47,7 @@ namespace SharpGLTF.Geometry.VertexTypes
 
             // determine the vertex attributes from the first vertex.
             var attributes = GetVertexAttributes(vertices[0], vertices.Count, vertexEncoding);
+            if (attributes == null || attributes.Length == 0) throw new InvalidOperationException("unable to retrieve attribute information from the vertex");
 
             // create a buffer
             int byteStride = attributes[0].ByteStride;