diff options
-rw-r--r-- | src/app.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
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<int> 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(); |