Skip to content

Commit

Permalink
Merge pull request #1583 from dorianvp/changeserver-args
Browse files Browse the repository at this point in the history
Handle case where args len is empty in `changeserver` command
  • Loading branch information
dorianvp authored Dec 6, 2024
2 parents 5bcb65a + 114f447 commit b145371
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions zingolib/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ impl Command for ChangeServerCommand {

fn exec(&self, args: &[&str], lightclient: &LightClient) -> String {
match args.len() {
0 => {
lightclient.set_server(http::Uri::default());
"server set".to_string()
}
1 => match http::Uri::from_str(args[0]) {
Ok(uri) => {
lightclient.set_server(uri);
Expand Down

0 comments on commit b145371

Please sign in to comment.