diff --git a/src/states_screens/dialogs/enter_player_name_dialog.cpp b/src/states_screens/dialogs/enter_player_name_dialog.cpp index 33df41c61..a3bfd6585 100644 --- a/src/states_screens/dialogs/enter_player_name_dialog.cpp +++ b/src/states_screens/dialogs/enter_player_name_dialog.cpp @@ -81,7 +81,20 @@ void EnterPlayerNameDialog::onEnterPressedInternal() // ---- Otherwise, accept entered name TextBoxWidget* textCtrl = getWidget("textfield"); stringw playerName = textCtrl->getText(); - if (playerName.size() > 0) + const int size = playerName.size(); + + // sanity check + int nonEmptyChars = 0; + for (int n=0; n 0 && nonEmptyChars > 0) { const bool success = OptionsScreenPlayers::getInstance()->gotNewPlayerName( playerName ); if (!success)