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:
parent
369fcb9928
commit
48fa4ca497
@ -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) => {
|
||||
|
Loading…
Reference in New Issue
Block a user