1
1
mirror of https://github.com/wez/wezterm.git synced 2024-08-17 10:10:23 +03:00

Fix crash when setting cursor on non-existent pointer

This commit is contained in:
V 2024-05-03 03:42:03 +02:00 committed by Wez Furlong
parent 369fcb9928
commit 48fa4ca497
No known key found for this signature in database
GPG Key ID: 7A7F66A31EC9B387

View File

@ -1,5 +1,5 @@
use std::any::Any;
use std::cell::{RefCell, RefMut};
use std::cell::RefCell;
use std::cmp::max;
use std::convert::TryInto;
use std::io::Read;
@ -912,7 +912,10 @@ impl WaylandWindowInner {
fn set_cursor(&mut self, cursor: Option<MouseCursor>) {
let conn = Connection::get().unwrap().wayland();
let state = conn.wayland_state.borrow_mut();
let pointer = RefMut::map(state, |s| s.pointer.as_mut().unwrap());
let pointer = match &state.pointer {
Some(pointer) => pointer,
None => return,
};
match cursor {
Some(cursor) => {