Skip to content

Commit

Permalink
tweak: forbid empty key values
Browse files Browse the repository at this point in the history
Signed-off-by: ljedrz <[email protected]>
  • Loading branch information
ljedrz committed Aug 25, 2023
1 parent 02a3c3f commit c23c207
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions cli/src/commands/start.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,13 @@ impl Start {
bail!("Both the private key string and file path flags were specified, please pick only one");
}

// If the private key is provided directly, don't do anything else.
if self.private_key.is_some() {
return Ok(());
// If the private key is provided directly, don't do anything else; make sure it's non-empty too.
if let Some(private_key) = &self.private_key {
if private_key.is_empty() {
bail!("The private-key argument can't be empty");
} else {
return Ok(());
}
}

// If a filesystem path to the private key is provided, attempt to
Expand Down

0 comments on commit c23c207

Please sign in to comment.