aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-09-12 11:29:35 +0200
committerMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-09-12 11:29:35 +0200
commit8702bacd3035f9c9c7fb64b7938cafd4b7a24fd6 (patch)
tree91b81cc6c83ff99a54cc82c888c91c451abb25d8 /src
parent3ec58ace778153427a161aca26192ba0279471bf (diff)
App: thoroughly check LayoutState availability in activate too
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
Diffstat (limited to 'src')
-rw-r--r--src/app.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/app.cpp b/src/app.cpp
index 6708706..47fb85c 100644
--- a/src/app.cpp
+++ b/src/app.cpp
@@ -392,7 +392,13 @@ char const *App::activate_surface(char const *drawing_name) {
return "Surface is not on any layer!";
}
- struct LayoutState &state = **this->layers.get_layout_state(*surface_id);
+ auto o_state = *this->layers.get_layout_state(*surface_id);
+
+ if (! o_state) {
+ return "Could not find layer for surface";
+ }
+
+ struct LayoutState &state = *o_state;
// disable layers that are above our current layer
for (auto const &l : this->layers.mapping) {