add resource validation

This commit is contained in:
ghost 2024-01-12 18:49:53 +02:00
parent b7a5314030
commit 9c9625cb21

View File

@ -19,7 +19,7 @@ class Master
$port
);
if ($this->_socket)
if (is_resource($this->_socket))
{
stream_set_timeout(
$this->_socket,
@ -37,7 +37,7 @@ class Master
): ?array
{
// Is connected
if (!$this->_socket)
if (!is_resource($this->_socket))
{
return null;
}