workspace taskbars: Minor fixes

- Add missing CSS class to manpage
- Fix rare segfault when address is not found (seems to only happen when compiled for production)
This commit is contained in:
Pol Rivero
2025-01-08 12:47:35 +01:00
parent 42affa4eda
commit e0f3695523
2 changed files with 5 additions and 5 deletions

View File

@ -548,12 +548,11 @@ void Workspaces::onWindowTitleEvent(std::string const &payload) {
Json::Value clientsData = gIPC->getSocket1JsonReply("clients");
std::string jsonWindowAddress = fmt::format("0x{}", payload);
auto client =
std::find_if(clientsData.begin(), clientsData.end(), [jsonWindowAddress](auto &client) {
return client["address"].asString() == jsonWindowAddress;
});
auto client = std::ranges::find_if(clientsData, [&jsonWindowAddress](auto &c) {
return c["address"].asString() == jsonWindowAddress;
});
if (!client->empty()) {
if (client != clientsData.end() && !client->empty()) {
(*inserter)({*client});
}
}