From dcc691ea141162040540df5c770d9ab6d46672ce Mon Sep 17 00:00:00 2001 From: Niklas Keller Date: Sun, 17 Sep 2017 22:11:18 +0200 Subject: [PATCH] Add guard for proc_terminate --- lib/Internal/Windows/Runner.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Internal/Windows/Runner.php b/lib/Internal/Windows/Runner.php index baa01ae..44ef750 100644 --- a/lib/Internal/Windows/Runner.php +++ b/lib/Internal/Windows/Runner.php @@ -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) {