1
0
mirror of https://github.com/danog/process.git synced 2024-12-02 17:51:46 +01:00

Add guard for proc_terminate

This commit is contained in:
Niklas Keller 2017-09-17 22:11:18 +02:00
parent 8aabd17000
commit dcc691ea14

View File

@ -144,7 +144,7 @@ final class Runner implements ProcessRunner {
/** @inheritdoc */
public function destroy(ProcessHandle $handle) {
/** @var Handle $handle */
if ($handle->status < ProcessStatus::ENDED) {
if ($handle->status < ProcessStatus::ENDED && \is_resource($handle->proc)) {
try {
$this->kill($handle);
} catch (ProcessException $e) {