Fix (wayfire/backend): Fixed unhandled exception (out_of_range) after no valid outputs in unordered_map

This commit is contained in:
muratyalcin-ce
2026-05-27 23:39:39 +03:00
parent 05945748dc
commit 31a161eb06
+3
View File
@@ -347,10 +347,13 @@ auto IPC::update_state_handler(const std::string& event, const Json::Value& data
if (event == "output-wset-changed") { if (event == "output-wset-changed") {
// data: { event, new-wset: wset.name, output: id, new-wset-data: wset, output-data: output } // data: { event, new-wset: wset.name, output: id, new-wset-data: wset, output-data: output }
try {
auto& output = state.outputs.at(data["output-data"]["name"].asString()); auto& output = state.outputs.at(data["output-data"]["name"].asString());
auto wset_idx = data["new-wset-data"]["index"].asUInt(); auto wset_idx = data["new-wset-data"]["index"].asUInt();
state.wsets.at(wset_idx).output = output; state.wsets.at(wset_idx).output = output;
output.wset_idx = wset_idx; output.wset_idx = wset_idx;
} catch (const std::exception&) {
}
return; return;
} }