fix crash when "running" first section in actions

This commit is contained in:
rabite 2020-01-22 14:16:36 +01:00
parent 7583e0a16e
commit 8c23d058ad
1 changed files with 7 additions and 1 deletions

View File

@ -160,10 +160,16 @@ impl ListView<Vec<QuickActions>> {
let selection = self.get_selection();
let selected_action_index = selection - fold_start_pos;
// Fixes crash when "running" first description and nicer to use
if self.is_description_selected() {
self.toggle_fold()?;
return Ok(());
}
self.content[current_fold]
.actions
// -1 because fold description takes one slot
.get()?[selected_action_index-1]
.get()?[selected_action_index - 1]
.run(self.content[0].files.clone(),
&self.core,
self.content[0].proc_view.clone())?;