Fix crash on empty savefile
This commit is contained in:
parent
4e46184f37
commit
14f503a554
@ -48,8 +48,12 @@ fn draw_seeding_tab(f: &mut Frame, app: &mut App) {
|
||||
f.render_stateful_widget(
|
||||
list,
|
||||
chunks[0],
|
||||
&mut ListState::default()
|
||||
.with_selected(Some(app.included_publications.len() - 1)),
|
||||
&mut ListState::default().with_selected(
|
||||
match app.included_publications.len() {
|
||||
0 => None,
|
||||
_ => Some(app.included_publications.len() - 1),
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
// Text entry
|
||||
|
||||
Loading…
Reference in New Issue
Block a user