fix: empty session name (#1959)
This commit is contained in:
parent
8b50ef96f3
commit
211d3b1a7f
1 changed files with 5 additions and 0 deletions
|
|
@ -198,6 +198,11 @@ pub(crate) fn assert_session(name: &str) {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn assert_session_ne(name: &str) {
|
pub(crate) fn assert_session_ne(name: &str) {
|
||||||
|
if name.trim().is_empty() {
|
||||||
|
eprintln!("Session name cannot be empty. Please provide a specific session name.");
|
||||||
|
process::exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
match session_exists(name) {
|
match session_exists(name) {
|
||||||
Ok(result) if !result => return,
|
Ok(result) if !result => return,
|
||||||
Ok(_) => println!("Session with name {:?} already exists. Use attach command to connect to it or specify a different name.", name),
|
Ok(_) => println!("Session with name {:?} already exists. Use attach command to connect to it or specify a different name.", name),
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue