diff --git a/src/Ami.php b/src/Ami.php index 45f332f..9a1a90e 100644 --- a/src/Ami.php +++ b/src/Ami.php @@ -379,7 +379,9 @@ public function disconnect() $this->logoff(); } - fclose($this->socket); + if (is_recource($this->socket)) { + fclose($this->socket); + } }//end disconnect()