Fix (wayfire/backend): Fixed unhandled exception (out_of_range) after no valid outputs in unordered_map
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user