Throw instead of assert on invalid file input

pull/3541/head
Max Vollmer 2020-12-14 16:44:56 +00:00
parent 5436e16802
commit 1db51503d8
1 changed files with 3 additions and 1 deletions

View File

@ -517,7 +517,9 @@ void glTF2Importer::ImportMeshes(glTF2::Asset &r) {
size_t count = prim.indices->count;
Accessor::Indexer data = prim.indices->GetIndexer();
ai_assert(data.IsValid());
if (!data.IsValid()) {
throw DeadlyImportError("GLTF: Invalid accessor without data in mesh ", getContextForErrorMessages(mesh.id, mesh.name));
}
switch (prim.mode) {
case PrimitiveMode_POINTS: {