Fix panic on empty WM_CLASS

This commit is contained in:
bbb651 2025-03-23 23:32:18 +02:00 committed by Shawn Wallace
parent 0fa13c6fb4
commit b2613aec05

View file

@ -569,7 +569,7 @@ impl XState {
0
};
let mut data = data[class_start..].to_vec();
if data.last().copied().unwrap() != 0 {
if data.last().copied() != Some(0) {
data.push(0);
}
let class = CString::from_vec_with_nul(data).unwrap();