From 60ba16a97cfcbdc6841fcc59efb6341c12a04f1a Mon Sep 17 00:00:00 2001 From: iff Date: Tue, 7 Jan 2025 02:07:08 +0100 Subject: [PATCH] fix: sudo panic --- core/src/suggestions.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/src/suggestions.rs b/core/src/suggestions.rs index 5eb42eb..bbd2bfb 100644 --- a/core/src/suggestions.rs +++ b/core/src/suggestions.rs @@ -11,6 +11,9 @@ use crate::shell::{add_candidates_no_dup, module_output, shell_evaluated_command use crate::style::highlight_difference; pub fn suggest_candidates(data: &mut Data) { + if data.split.is_empty() { + return; + } let executable = &data.split[0] .rsplit(std::path::MAIN_SEPARATOR) .next()