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) {