From 629e7957844a363e3ee4909323da39cd12deafdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Tue, 23 Sep 2025 02:23:32 +0200 Subject: [PATCH] Avoid underflow in `stack` widget Fixes #3062 --- widget/src/stack.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/widget/src/stack.rs b/widget/src/stack.rs index 65c5aeb0..2a062ee4 100644 --- a/widget/src/stack.rs +++ b/widget/src/stack.rs @@ -217,6 +217,10 @@ where shell: &mut Shell<'_, Message>, viewport: &Rectangle, ) { + if self.children.is_empty() { + return; + } + let is_over = cursor.is_over(layout.bounds()); let end = self.children.len() - 1;