Protect again starting command without anything in command

This commit is contained in:
Félix Saparelli 2021-08-23 02:32:48 +12:00
parent 17b09d8798
commit 4843920a36
No known key found for this signature in database
GPG Key ID: B948C4BAE44FC474
1 changed files with 4 additions and 0 deletions

View File

@ -240,6 +240,9 @@ async fn apply_outcome(
warn!(is_running=?p.is_some(), outcome=?o, "outcome does not apply to process state");
}
(None, Outcome::Start) => {
if working.command.is_empty() {
warn!("tried to start a command without anything to run");
} else {
let mut command = working.shell.to_command(&working.command);
// TODO: pre-spawn hook
@ -253,6 +256,7 @@ async fn apply_outcome(
// TODO: post-spawn hook
*process = Some(proc);
}
}
(Some(p), Outcome::Signal(sig)) => {