Browse Source

Do not crash on invalid file, closes #21083

Juan Linietsky 6 years ago
parent
commit
9efc6d85d8
1 changed files with 1 additions and 1 deletions
  1. 1 1
      editor/import/editor_scene_importer_gltf.cpp

+ 1 - 1
editor/import/editor_scene_importer_gltf.cpp

@@ -1695,7 +1695,7 @@ void EditorSceneImporterGLTF::_generate_node(GLTFState &state, int p_node, 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);
 
 		Skeleton *s = skeletons[n->skin];