summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorYuri Roubinsky <chaosus89@gmail.com>2021-05-26 19:28:38 +0300
committerYuri Roubinsky <chaosus89@gmail.com>2021-05-26 19:28:38 +0300
commitaf3f047f490da67af8b8ec5b662b9e6fc7c7dde9 (patch)
tree68a92640452e79cc13c0c8a3e5952465566ec8c2 /editor
parent27baa12670fbcde6e9336cbaa7bed7ae3aa20944 (diff)
Fixed console error spam (about invalid edited scene index)
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_inspector.cpp2
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp2
-rw-r--r--editor/plugins/script_editor_plugin.cpp6
3 files changed, 6 insertions, 4 deletions
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp
index 0616ab07bd..f869031446 100644
--- a/editor/editor_inspector.cpp
+++ b/editor/editor_inspector.cpp
@@ -1626,7 +1626,7 @@ void EditorInspector::update_tree() {
bool draw_red = false;
- {
+ if (is_inside_tree()) {
Node *nod = Object::cast_to<Node>(object);
Node *es = EditorNode::get_singleton()->get_edited_scene();
if (nod && es != nod && nod->get_owner() != es) {
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index 21bff41498..5811e2b9ba 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -4380,7 +4380,7 @@ void CanvasItemEditor::_update_scrollbars() {
// Calculate scrollable area.
Rect2 canvas_item_rect = Rect2(Point2(), screen_rect);
- if (editor->get_edited_scene()) {
+ if (editor->is_inside_tree() && editor->get_edited_scene()) {
Rect2 content_rect = _get_encompassing_rect(editor->get_edited_scene());
canvas_item_rect.expand_to(content_rect.position);
canvas_item_rect.expand_to(content_rect.position + content_rect.size);
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index 1147267ce0..623e4ea66e 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -1504,8 +1504,10 @@ void ScriptEditor::_notification(int p_what) {
recent_scripts->set_as_minsize();
- _update_script_colors();
- _update_script_names();
+ if (is_inside_tree()) {
+ _update_script_colors();
+ _update_script_names();
+ }
} break;
case NOTIFICATION_READY: {