Throw instead of assert on invalid file input
parent
5436e16802
commit
1db51503d8
|
@ -517,7 +517,9 @@ void glTF2Importer::ImportMeshes(glTF2::Asset &r) {
|
||||||
size_t count = prim.indices->count;
|
size_t count = prim.indices->count;
|
||||||
|
|
||||||
Accessor::Indexer data = prim.indices->GetIndexer();
|
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) {
|
switch (prim.mode) {
|
||||||
case PrimitiveMode_POINTS: {
|
case PrimitiveMode_POINTS: {
|
||||||
|
|
Loading…
Reference in New Issue