Don't call back() if open_window_stack is empty since that's UB.
Backport of #7162
This commit is contained in:
parent
11e0e27670
commit
1acd78661f
1 changed files with 2 additions and 1 deletions
|
@ -316,7 +316,8 @@ void text_box_base::cursor_timer_callback()
|
|||
cursor_alpha_ = 255;
|
||||
return;
|
||||
default:
|
||||
if(get_window() != open_window_stack.back()) {
|
||||
// back() on an empty vector is UB and was causing a crash when run on Wayland (see #7104 on github)
|
||||
if(!open_window_stack.empty() && get_window() != open_window_stack.back()) {
|
||||
cursor_alpha_ = 0;
|
||||
} else {
|
||||
cursor_alpha_ = (~cursor_alpha_) & 0xFF;
|
||||
|
|
Loading…
Add table
Reference in a new issue