Strip servers with empty name

This commit is contained in:
Louvenarde 2024-02-03 16:04:46 +01:00
parent 8a9fe6d78f
commit 5bc79bac59

View File

@ -632,8 +632,8 @@ namespace Components
server.hostname = server.hostname.substr(0, MAX_SERVER_NAME_LENGTH); server.hostname = server.hostname.substr(0, MAX_SERVER_NAME_LENGTH);
#endif #endif
const auto strippedHostName = TextRenderer::StripMaterialTextIcons(server.hostname);
if (server.hostname.empty() || TextRenderer::StripMaterialTextIcons(server.hostname).empty()) if (server.hostname.empty() || strippedHostName.empty() || std::all_of(strippedHostName.begin(), strippedHostName.end(), isspace))
{ {
// Invalid server name containing only emojis // Invalid server name containing only emojis
return; return;