Browse Source

Improve error message when Mesh:setVertexMap is used with an empty array.

Sasha Szpakowski 1 year ago
parent
commit
691d910c3e
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/modules/graphics/Mesh.cpp

+ 3 - 0
src/modules/graphics/Mesh.cpp

@@ -320,6 +320,9 @@ static void copyToIndexBuffer(const std::vector<uint32> &indices, void *data, si
 
 void Mesh::setVertexMap(const std::vector<uint32> &map)
 {
+	if (map.empty())
+		throw love::Exception("Vertex map array must not be empty.");
+
 	size_t maxval = getVertexCount();
 
 	IndexDataType datatype = getIndexDataTypeFromMax(maxval);