mirror of
https://github.com/nushell/nushell
synced 2024-12-28 22:13:10 +00:00
fix: panic! during parsing (#4107)
Typing `selector -qa` into nu would cause a `panic!` This was the case because the inner loop incremented the `idx` that was only checked in the outer loop and used it to index into `lite_cmd.parts[idx]` With the fix we now break loop. Co-authored-by: ahkrr <alexhk@protonmail.com>
This commit is contained in:
parent
df6a53f52e
commit
649b3804c1
1 changed files with 10 additions and 5 deletions
|
@ -1559,11 +1559,16 @@ fn parse_internal_command(
|
||||||
if error.is_none() {
|
if error.is_none() {
|
||||||
error = err;
|
error = err;
|
||||||
}
|
}
|
||||||
} else if error.is_none() {
|
} else {
|
||||||
error = Some(ParseError::argument_error(
|
if error.is_none() {
|
||||||
lite_cmd.parts[0].clone(),
|
error = Some(ParseError::argument_error(
|
||||||
ArgumentError::MissingValueForName(full_name.to_owned()),
|
lite_cmd.parts[0].clone(),
|
||||||
));
|
ArgumentError::MissingValueForName(
|
||||||
|
full_name.to_owned(),
|
||||||
|
),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue