Added check for SceneTree being null
(cherry picked from commit 51501dadcc
)
This commit is contained in:
parent
4f38a9e4d6
commit
e88f387958
1 changed files with 4 additions and 0 deletions
|
@ -362,6 +362,10 @@ void Viewport::_notification(int p_what) {
|
|||
VS::get_singleton()->viewport_set_active(viewport, false);
|
||||
} break;
|
||||
case NOTIFICATION_INTERNAL_PHYSICS_PROCESS: {
|
||||
if (!get_tree()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (get_tree()->is_debugging_collisions_hint() && contact_2d_debug.is_valid()) {
|
||||
VisualServer::get_singleton()->canvas_item_clear(contact_2d_debug);
|
||||
VisualServer::get_singleton()->canvas_item_set_draw_index(contact_2d_debug, 0xFFFFF); //very high index
|
||||
|
|
Loading…
Reference in a new issue