Don't unwrap client

If Smithay posts an error, client will become None immediately, even
while the surface may still receive events.
This commit is contained in:
Ivan Molodetskikh
2024-05-05 11:14:46 +04:00
parent 65b9c74f62
commit df0ee996ee
+4 -2
View File
@@ -59,8 +59,9 @@ impl CompositorHandler for State {
});
if let Some(dmabuf) = maybe_dmabuf {
if let Ok((blocker, source)) = dmabuf.generate_blocker(Interest::READ) {
let client = surface.client().unwrap();
let res = state
if let Some(client) = surface.client() {
let res =
state
.niri
.event_loop
.insert_source(source, move |_, _, state| {
@@ -75,6 +76,7 @@ impl CompositorHandler for State {
}
}
}
}
});
}