X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?p=staging%2Fwindowmanager.git;a=blobdiff_plain;f=src%2Fapp.cpp;h=4feeb03056b2aacac0de9de17a7634d56720fa6a;hp=3085c61278c03c88b674a40a7a4d3b586e6b08c3;hb=9b397b09fe6eef8936ad41763e4908e99ce274d6;hpb=b02a0011c13e4945ec97eef1efad13b3a87c6016 diff --git a/src/app.cpp b/src/app.cpp index 3085c61..4feeb03 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -678,7 +678,8 @@ result App::api_request_surface(char const *drawing_name) { } void App::activate(int id) { - if (this->controller->sprops[id].visibility == 0) { + auto ip = this->controller->sprops.find(id); + if (ip != this->controller->sprops.end() && ip->second.visibility == 0) { this->controller->surfaces[id]->set_visibility(1); char const *label = this->lookup_name(id).value_or("unknown-name").c_str(); @@ -688,7 +689,8 @@ void App::activate(int id) { } void App::deactivate(int id) { - if (this->controller->sprops[id].visibility != 0) { + auto ip = this->controller->sprops.find(id); + if (ip != this->controller->sprops.end() && ip->second.visibility != 0) { this->controller->surfaces[id]->set_visibility(0); char const *label = this->lookup_name(id).value_or("unknown-name").c_str();