Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 08e1a69

Browse files
committedJul 27, 2023
Merge pull request #79937 from Sauermann/fix-expected-safe-rect-error
Disable error condition for accessing safe rect
2 parents 7a9a0dc + 7fead97 commit 08e1a69

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed
 

‎scene/main/viewport.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -3510,7 +3510,12 @@ void Viewport::subwindow_set_popup_safe_rect(Window *p_window, const Rect2i &p_r
35103510

35113511
Rect2i Viewport::subwindow_get_popup_safe_rect(Window *p_window) const {
35123512
int index = _sub_window_find(p_window);
3513-
ERR_FAIL_COND_V(index == -1, Rect2i());
3513+
// FIXME: Re-enable ERR_FAIL_COND after rewriting embedded window popup closing.
3514+
// Currently it is expected, that index == -1 can happen.
3515+
if (index == -1) {
3516+
return Rect2i();
3517+
}
3518+
// ERR_FAIL_COND_V(index == -1, Rect2i());
35143519

35153520
return gui.sub_windows[index].parent_safe_rect;
35163521
}

0 commit comments

Comments
 (0)
Please sign in to comment.