Fix crash on scenes with tool scripts and mismatched node types

This commit is contained in:
SaracenOne 2021-08-27 14:32:28 +01:00
parent 00268e37a0
commit 1fbbe25cea

View File

@ -2656,13 +2656,15 @@ void EditorInspector::_update_script_class_properties(const Object &p_object, Li
} }
// NodeC -> C props... -> NodeB..C.. // NodeC -> C props... -> NodeB..C..
r_list.erase(script_variables); if (script_variables) {
List<PropertyInfo>::Element *to_delete = bottom->next(); r_list.erase(script_variables);
while (to_delete && !(to_delete->get().usage & PROPERTY_USAGE_CATEGORY)) { List<PropertyInfo>::Element *to_delete = bottom->next();
r_list.erase(to_delete); while (to_delete && !(to_delete->get().usage & PROPERTY_USAGE_CATEGORY)) {
to_delete = bottom->next(); r_list.erase(to_delete);
to_delete = bottom->next();
}
r_list.erase(bottom);
} }
r_list.erase(bottom);
} }
void EditorInspector::set_restrict_to_basic_settings(bool p_restrict) { void EditorInspector::set_restrict_to_basic_settings(bool p_restrict) {