Skip to content

Commit 9387f65

Browse files
committed
Fixed missing check socket
1 parent 233bb97 commit 9387f65

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Socket.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,11 @@ public function read(IUnpacker $unpacker)
132132
*/
133133
public function readBuffer(int $length = 2048): string
134134
{
135+
if (!is_resource($this->socket)) {
136+
Bolt::error('Not initialized socket');
137+
return;
138+
}
139+
135140
$output = '';
136141
do {
137142
$readed = socket_read($this->socket, $length - mb_strlen($output, '8bit'), PHP_BINARY_READ);

0 commit comments

Comments
 (0)