forked from extern/nushell
check to make sure we have data first (#4484)
This commit is contained in:
parent
56b3fc61a3
commit
f11fa99d30
@ -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 New Issue
Block a user