Code Review
/
staging
/
windowmanager.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
App: be more thorough when checking surface-associated LayoutState
[staging/windowmanager.git]
/
src
/
app.cpp
diff --git
a/src/app.cpp
b/src/app.cpp
index
59b762d
..
6708706
100644
(file)
--- 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";
}
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";
if (state.main == -1) {
return "No surface active";