summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2021-08-27 16:58:17 +0200
committerGitHub <noreply@github.com>2021-08-27 16:58:17 +0200
commit39c25d5bf327f205e00647e3c042c8a0904b3c13 (patch)
tree3c1e3a8c92d0e09a952d34450dcc2c98fa14576e /editor
parent00268e37a0e40630ce76b5144cb272c4cc73a672 (diff)
parent1fbbe25ceac593c82d4dd8e3ce978a9e241c6587 (diff)
Merge pull request #52156 from V-Sekai/missing_script_variables_fix
Fix crash on scenes with tool scripts and mismatched node types
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_inspector.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp
index 380b205bad..fee27dae58 100644
--- a/editor/editor_inspector.cpp
+++ b/editor/editor_inspector.cpp
@@ -2656,13 +2656,15 @@ void EditorInspector::_update_script_class_properties(const Object &p_object, Li
}
// NodeC -> C props... -> NodeB..C..
- r_list.erase(script_variables);
- List<PropertyInfo>::Element *to_delete = bottom->next();
- while (to_delete && !(to_delete->get().usage & PROPERTY_USAGE_CATEGORY)) {
- r_list.erase(to_delete);
- to_delete = bottom->next();
+ if (script_variables) {
+ r_list.erase(script_variables);
+ List<PropertyInfo>::Element *to_delete = bottom->next();
+ while (to_delete && !(to_delete->get().usage & PROPERTY_USAGE_CATEGORY)) {
+ 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) {