Skip to content

Commit 9a5d6d1

Browse files
committed
Merge pull request #111389 from nikitalita/gltf-fix-export-prop
Fix segfault in GLTFDocument::export_object_model_property
2 parents 4ad9114 + bca701f commit 9a5d6d1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

modules/gltf/gltf_document.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7066,7 +7066,8 @@ Ref<GLTFObjectModelProperty> GLTFDocument::export_object_model_property(Ref<GLTF
70667066
const Vector<StringName> subpath = p_node_path.get_subnames();
70677067
ERR_FAIL_COND_V_MSG(subpath.is_empty(), ret, "glTF: Cannot export empty property. No property was specified in the NodePath: " + String(p_node_path));
70687068
int target_prop_depth = 0;
7069-
for (StringName subname : subpath) {
7069+
for (int64_t i = 0; i < subpath.size() - 1; i++) {
7070+
const StringName &subname = subpath[i];
70707071
Variant target_property = target_object->get(subname);
70717072
if (target_property.get_type() == Variant::OBJECT) {
70727073
target_object = target_property;

0 commit comments

Comments
 (0)