Skip to content

Commit

Permalink
Update Server.php
Browse files Browse the repository at this point in the history
  • Loading branch information
localzet committed Dec 2, 2024
1 parent 6635181 commit 51c1541
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
use localzet\Server\Connection\ConnectionInterface;
use localzet\Server\Connection\TcpConnection;
use localzet\ServerAbstract;
use Throwable;

class Server extends ServerAbstract
{
Expand Down Expand Up @@ -98,7 +99,11 @@ public function onMessage(ConnectionInterface &$connection, mixed $request): voi
if (!$request) {
return;
}
$data = unserialize($request);
try {
$data = unserialize($request);
} catch (Throwable) {
return;
}
$type = $data['type'];
$channels = $data['channels'];
$event_data = $data['data'] ?? null;
Expand Down

0 comments on commit 51c1541

Please sign in to comment.