summaryrefslogtreecommitdiff
path: root/scene/main
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-12-13 12:06:00 +0100
committerGitHub <noreply@github.com>2021-12-13 12:06:00 +0100
commita5c14bd10214ba10f5b37452dc4ce428c3427c9c (patch)
tree1bd3f964c38b39f8cf369b21f42f42978746dd65 /scene/main
parent7b675da618e422d21068f22d82bb2671705b342a (diff)
parent51501dadcce344ebf83420d93997c9b82ede65f8 (diff)
Merge pull request #55890 from Vitika9/54100
Diffstat (limited to 'scene/main')
-rw-r--r--scene/main/viewport.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index 007e5d1173..34845d5875 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -462,6 +462,10 @@ void Viewport::_notification(int p_what) {
RenderingServer::get_singleton()->viewport_set_parent_viewport(viewport, RID());
} break;
case NOTIFICATION_INTERNAL_PHYSICS_PROCESS: {
+ if (!get_tree()) {
+ return;
+ }
+
if (get_tree()->is_debugging_collisions_hint() && contact_2d_debug.is_valid()) {
RenderingServer::get_singleton()->canvas_item_clear(contact_2d_debug);
RenderingServer::get_singleton()->canvas_item_set_draw_index(contact_2d_debug, 0xFFFFF); //very high index