Quellcode durchsuchen

Fix a crash in get_static_property_type_indexed

Fixes #13243
Bojidar Marinov vor 7 Jahren
Ursprung
Commit
0b63e84566
1 geänderte Dateien mit 7 neuen und 0 gelöschten Zeilen
  1. 7 0
      core/object.cpp

+ 7 - 0
core/object.cpp

@@ -1749,6 +1749,13 @@ Variant::Type Object::get_static_property_type(const StringName &p_property, boo
 
 Variant::Type Object::get_static_property_type_indexed(const Vector<StringName> &p_path, bool *r_valid) const {
 
+	if (p_path.size() == 0) {
+		if (r_valid)
+			*r_valid = false;
+
+		return Variant::NIL;
+	}
+
 	bool valid = false;
 	Variant::Type t = get_static_property_type(p_path[0], &valid);
 	if (!valid) {