1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2024-11-22 21:39:21 +00:00

Fix array indexing issue

This commit is contained in:
Pierre HUBERT 2021-05-05 07:38:40 +02:00
parent d1d0f5818f
commit 21729fc877

View File

@ -86,7 +86,10 @@ async fn main() -> std::io::Result<()> {
std::process::exit(-2); std::process::exit(-2);
} }
let args = &args[3..]; let args = match args.len() {
0 | 1 | 2 => vec![],
_ => (&args[3..]).to_vec()
};
let res = (selected_action.function)(args.to_vec()); let res = (selected_action.function)(args.to_vec());
res.expect("Failed to execute action!"); res.expect("Failed to execute action!");