Skip to content
This repository was archived by the owner on Oct 30, 2024. It is now read-only.

Commit 33a7e17

Browse files
authored
TASK: Close should check if the current socket is null
If we call close (by ex. during a reconnect) but the streamSocket is null, we generate useless error for the user.
1 parent d1fc1da commit 33a7e17

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/Nats/Connection.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,9 @@ public function setChunkSize($chunkSize)
492492
*/
493493
public function close()
494494
{
495+
if ($this->streamSocket === null) {
496+
return;
497+
}
495498
fclose($this->streamSocket);
496499
$this->streamSocket = null;
497500
}

0 commit comments

Comments
 (0)