From 2ee2ca7a38aece73ca4efd27f349de24f79ed01f Mon Sep 17 00:00:00 2001 From: MihailRis Date: Tue, 4 Jun 2024 23:20:22 +0300 Subject: [PATCH] fix: empty textbox double click causes fatal error --- src/graphics/ui/elements/TextBox.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/graphics/ui/elements/TextBox.cpp b/src/graphics/ui/elements/TextBox.cpp index 43b6304e..ac454c42 100644 --- a/src/graphics/ui/elements/TextBox.cpp +++ b/src/graphics/ui/elements/TextBox.cpp @@ -337,6 +337,9 @@ inline std::wstring get_alphabet(wchar_t c) { } void TextBox::tokenSelectAt(int index) { + if (input.empty()) { + return; + } int left = index; int right = index;