mirror of
https://github.com/nushell/nushell
synced 2024-12-27 05:23:11 +00:00
check to make sure we have data first (#4484)
This commit is contained in:
parent
56b3fc61a3
commit
f11fa99d30
1 changed files with 7 additions and 0 deletions
|
@ -138,6 +138,13 @@ pub fn sort(
|
|||
insensitive: bool,
|
||||
config: &Config,
|
||||
) -> Result<(), ShellError> {
|
||||
if vec.is_empty() {
|
||||
return Err(ShellError::LabeledError(
|
||||
"no values to work with".to_string(),
|
||||
"no values to work with".to_string(),
|
||||
));
|
||||
}
|
||||
|
||||
match &vec[0] {
|
||||
Value::Record {
|
||||
cols,
|
||||
|
|
Loading…
Reference in a new issue