Avoid a crash when user name is empty

This commit is contained in:
Deve 2018-06-12 23:01:13 +02:00
parent e44266b526
commit 7d9adf5b93

View File

@ -245,6 +245,13 @@ void RegisterScreen::doRegister()
{
stringw local_name = getWidget<TextBoxWidget>("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);