Skip to content

Commit 2d5c5b4

Browse files
committed
fix(desktop settings): clamp selected menu index to prevent RangeError
1 parent 1c503d9 commit 2d5c5b4

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

lib/pages_desktop_specific/settings/desktop_settings_view.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,10 @@ class _DesktopSettingsViewState extends ConsumerState<DesktopSettingsView> {
119119
),
120120
),
121121
Expanded(
122-
child:
123-
contentViews[ref
124-
.watch(selectedSettingsMenuItemStateProvider.state)
125-
.state],
122+
child: contentViews[
123+
(ref.watch(selectedSettingsMenuItemStateProvider.state).state)
124+
.clamp(0, contentViews.length - 1)
125+
],
126126
),
127127
],
128128
),

0 commit comments

Comments
 (0)