mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 07:17:42 -05:00
fix gdextension Object/Node::to_string to check is_valid before returning the result
at best, this results in an empty string, at worst, the result is never initialised when is_valid is false.
This commit is contained in:
@@ -978,7 +978,9 @@ String Object::to_string() {
|
||||
String ret;
|
||||
GDExtensionBool is_valid;
|
||||
_extension->to_string(_extension_instance, &is_valid, &ret);
|
||||
return ret;
|
||||
if (is_valid) {
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
return "<" + get_class() + "#" + itos(get_instance_id()) + ">";
|
||||
}
|
||||
|
||||
@@ -2864,7 +2864,9 @@ String Node::to_string() {
|
||||
String ret;
|
||||
GDExtensionBool is_valid;
|
||||
_get_extension()->to_string(_get_extension_instance(), &is_valid, &ret);
|
||||
return ret;
|
||||
if (is_valid) {
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
return (get_name() ? String(get_name()) + ":" : "") + Object::to_string();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user