Do not crash on invalid file, closes #21083

This commit is contained in:
Juan Linietsky 2018-11-22 17:26:31 -03:00
parent 7a9e4c2602
commit 9efc6d85d8
1 changed files with 1 additions and 1 deletions

View File

@ -1695,7 +1695,7 @@ void EditorSceneImporterGLTF::_generate_node(GLTFState &state, int p_node, Node
n->godot_nodes.push_back(node); n->godot_nodes.push_back(node);
if (n->skin >= 0 && Object::cast_to<MeshInstance>(node)) { if (n->skin >= 0 && n->skin < skeletons.size() && Object::cast_to<MeshInstance>(node)) {
MeshInstance *mi = Object::cast_to<MeshInstance>(node); MeshInstance *mi = Object::cast_to<MeshInstance>(node);
Skeleton *s = skeletons[n->skin]; Skeleton *s = skeletons[n->skin];