diff options
author | 2017-09-12 11:29:35 +0200 | |
---|---|---|
committer | 2017-09-12 11:29:35 +0200 | |
commit | 3ec58ace778153427a161aca26192ba0279471bf (patch) | |
tree | d7bfe8fd17902775f98c17c8ad3f67907810b3d7 /src/app.cpp | |
parent | 65542e2498c33d534a9ab8037c3e0f1b263a6077 (diff) |
App: be more thorough when checking surface-associated LayoutState
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
Diffstat (limited to 'src/app.cpp')
-rw-r--r-- | src/app.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/app.cpp b/src/app.cpp index 59b762d..6708706 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -493,7 +493,13 @@ char const *App::deactivate_surface(char const *drawing_name) { return "Cannot deactivate main_surface"; } - 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; if (state.main == -1) { return "No surface active"; |