diff --git a/src/Parallel/ValueObject/ParallelProcess.php b/src/Parallel/ValueObject/ParallelProcess.php index 914f03eeacc..d9a105071ff 100644 --- a/src/Parallel/ValueObject/ParallelProcess.php +++ b/src/Parallel/ValueObject/ParallelProcess.php @@ -116,7 +116,11 @@ public function quit(): void $pipe->close(); } - $this->encoder->end(); + // the process can be quit before its connection is bound, e.g. on quitAll() after an error; + // in that case the encoder was never set + if (isset($this->encoder)) { + $this->encoder->end(); + } } public function bindConnection(Decoder $decoder, Encoder $encoder): void