From 5bc79bac59a5a2578fcd2dca54db88a9d716eb62 Mon Sep 17 00:00:00 2001 From: Louvenarde Date: Sat, 3 Feb 2024 16:04:46 +0100 Subject: [PATCH] Strip servers with empty name --- src/Components/Modules/ServerList.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Components/Modules/ServerList.cpp b/src/Components/Modules/ServerList.cpp index d069decf..f3fc8f8b 100644 --- a/src/Components/Modules/ServerList.cpp +++ b/src/Components/Modules/ServerList.cpp @@ -632,8 +632,8 @@ namespace Components server.hostname = server.hostname.substr(0, MAX_SERVER_NAME_LENGTH); #endif - - if (server.hostname.empty() || TextRenderer::StripMaterialTextIcons(server.hostname).empty()) + const auto strippedHostName = TextRenderer::StripMaterialTextIcons(server.hostname); + if (server.hostname.empty() || strippedHostName.empty() || std::all_of(strippedHostName.begin(), strippedHostName.end(), isspace)) { // Invalid server name containing only emojis return;