1
0
mirror of https://github.com/godotengine/godot.git synced 2026-01-05 19:31:35 +00:00

Fix crash when removing SpinBox during text submit

This commit is contained in:
Aaron Franke
2023-06-01 20:49:39 -05:00
parent db5113de36
commit d3e4db4a7b

View File

@@ -202,7 +202,8 @@ void SpinBox::_line_edit_focus_enter() {
void SpinBox::_line_edit_focus_exit() {
// Discontinue because the focus_exit was caused by left-clicking the arrows.
if (get_viewport()->gui_get_focus_owner() == get_line_edit()) {
Viewport *viewport = get_viewport();
if (!viewport || viewport->gui_get_focus_owner() == get_line_edit()) {
return;
}
// Discontinue because the focus_exit was caused by right-click context menu.