Do not crash on invalid file, closes #21083
This commit is contained in:
parent
7a9e4c2602
commit
9efc6d85d8
|
@ -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];
|
||||
|
|
Loading…
Reference in New Issue