diff --git a/src/greeter.rs b/src/greeter.rs index 59771a2..c19ba9d 100644 --- a/src/greeter.rs +++ b/src/greeter.rs @@ -604,7 +604,11 @@ impl App { widget::container( widget::button::custom( widget::text( - self.common.active_layouts[self.common.current_keyboard_layout].name(), + self.common + .active_layouts + .get(self.common.current_keyboard_layout) + .map(|x| x.name()) + .unwrap_or_default(), ) .ellipsize(Ellipsize::End(EllipsizeHeightLimit::Lines(1))) .height(16) diff --git a/src/locker.rs b/src/locker.rs index 6d913fd..ce1b3d1 100644 --- a/src/locker.rs +++ b/src/locker.rs @@ -421,7 +421,11 @@ impl App { widget::container( widget::button::custom( widget::text( - self.common.active_layouts[self.common.current_keyboard_layout].name(), + self.common + .active_layouts + .get(self.common.current_keyboard_layout) + .map(|x| x.name()) + .unwrap_or_default(), ) .ellipsize(Ellipsize::End(EllipsizeHeightLimit::Lines(1))) .height(16)