From 3c6f236df31bd64f583aaec998047b5e36f73f09 Mon Sep 17 00:00:00 2001 From: its your bedtime <23366927+itsyourbedtime@users.noreply.github.com> Date: Mon, 7 Jun 2021 18:49:56 +0300 Subject: [PATCH] prevent "enter/save" key callback if string is empty (#509) Co-authored-by: SG --- applications/gui/modules/text_input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/gui/modules/text_input.c b/applications/gui/modules/text_input.c index 2afe7368..4900afbb 100644 --- a/applications/gui/modules/text_input.c +++ b/applications/gui/modules/text_input.c @@ -289,7 +289,7 @@ static void text_input_handle_ok(TextInput* text_input) { uint8_t text_length = strlen(model->text); if(selected == ENTER_KEY) { - if(model->callback != 0) { + if(model->callback != 0 && text_length > 0) { model->callback(model->callback_context, model->text); } } else if(selected == BACKSPACE_KEY) {