소스 검색

added extra check for AOT cases

vpenades 1 년 전
부모
커밋
30a9d83c26
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      src/SharpGLTF.Toolkit/Geometry/VertexTypes/VertexUtils.Accessors.cs

+ 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;