From 15d0e56961a7f705cf7ac216b10ca5ab005bc0eb Mon Sep 17 00:00:00 2001
From: kobewi <kobewi4e@gmail.com>
Date: Fri, 31 Jan 2025 13:20:36 +0100
Subject: [PATCH] Fix crash when ProgressDialog is outside tree

---
 editor/progress_dialog.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/editor/progress_dialog.cpp b/editor/progress_dialog.cpp
index dae7578a4eb9..2f551a4e57b9 100644
--- a/editor/progress_dialog.cpp
+++ b/editor/progress_dialog.cpp
@@ -166,7 +166,8 @@ void ProgressDialog::_popup() {
 
 	center_panel->set_custom_minimum_size(ms);
 
-	Window *current_window = get_last_exclusive_window();
+	Window *current_window = SceneTree::get_singleton()->get_root()->get_last_exclusive_window();
+	ERR_FAIL_NULL(current_window);
 	reparent(current_window);
 
 	// Ensures that events are properly released before the dialog blocks input.