mirror of
https://github.com/nushell/nushell
synced 2024-12-29 06: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,
|
insensitive: bool,
|
||||||
config: &Config,
|
config: &Config,
|
||||||
) -> Result<(), ShellError> {
|
) -> 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] {
|
match &vec[0] {
|
||||||
Value::Record {
|
Value::Record {
|
||||||
cols,
|
cols,
|
||||||
|
|
Loading…
Reference in a new issue