Merge pull request #43118 from timothyqiu/revert-inherited-default

Fix property revert for inherited child nodes
This commit is contained in:
Rémi Verschelde 2020-10-27 08:38:06 +01:00 committed by GitHub
commit 1a1140d92b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -414,9 +414,9 @@ bool EditorPropertyRevert::get_instanced_node_original_property(Node *p_node, co
node = node->get_owner();
}
if (!found && node) {
if (!found && p_node) {
//if not found, try default class value
Variant attempt = ClassDB::class_get_default_property_value(node->get_class_name(), p_prop);
Variant attempt = ClassDB::class_get_default_property_value(p_node->get_class_name(), p_prop);
if (attempt.get_type() != Variant::NIL) {
found = true;
value = attempt;