From 5e337b31ebcf4509e1cf4cb64b02908ade59df05 Mon Sep 17 00:00:00 2001 From: shaderbeast Date: Sun, 1 Sep 2019 01:25:22 +0200 Subject: Added is_inside_tree() check in both Timer and Tween Tween now throws error and doesnt even execute. --- scene/gui/control.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'scene/gui') diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 034e9266f6..174c2fce7d 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -2149,9 +2149,7 @@ bool Control::has_focus() const { void Control::grab_focus() { - if (!is_inside_tree()) { - ERR_FAIL_COND(!is_inside_tree()); - } + ERR_FAIL_COND(!is_inside_tree()); if (data.focus_mode == FOCUS_NONE) { WARN_PRINT("This control can't grab focus. Use set_focus_mode() to allow a control to get focus."); -- cgit v1.2.3