From 15035498b3a1388dcb5bc743350d188e6fd5c1c0 Mon Sep 17 00:00:00 2001 From: ghost Date: Fri, 12 Jan 2024 20:26:51 +0200 Subject: [PATCH] add socket check --- src/Xash3D/Master.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Xash3D/Master.php b/src/Xash3D/Master.php index 2909d64..8f1dc61 100644 --- a/src/Xash3D/Master.php +++ b/src/Xash3D/Master.php @@ -42,9 +42,12 @@ class Master public function __destruct() { - fclose( - $this->_socket - ); + if (true === is_resource($this->_socket)) + { + fclose( + $this->_socket + ); + } } public function getServersIPv6(