From 7d9adf5b935feee810cd9474fe4e72b4796a291f Mon Sep 17 00:00:00 2001 From: Deve Date: Tue, 12 Jun 2018 23:01:13 +0200 Subject: [PATCH] Avoid a crash when user name is empty --- src/states_screens/register_screen.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/states_screens/register_screen.cpp b/src/states_screens/register_screen.cpp index bf0805663..dcad9e46e 100644 --- a/src/states_screens/register_screen.cpp +++ b/src/states_screens/register_screen.cpp @@ -245,6 +245,13 @@ void RegisterScreen::doRegister() { stringw local_name = getWidget("local_username") ->getText().trim(); + + if (local_name.empty()) + { + m_info_widget->setErrorColor(); + m_info_widget->setText(_("User name cannot be empty."), false); + return; + } handleLocalName(local_name);