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

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)) => {