From 0fdb7795e104e192b90c60556916ab93e6b83750 Mon Sep 17 00:00:00 2001 From: Florian Rey Date: Thu, 10 Oct 2013 13:40:26 +0200 Subject: [PATCH] Test for connection attachement before cascading error --- WsServer.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/WsServer.php b/WsServer.php index 9337934..1b7c199 100644 --- a/WsServer.php +++ b/WsServer.php @@ -150,7 +150,9 @@ class WsServer implements HttpServerInterface { */ public function onError(ConnectionInterface $conn, \Exception $e) { if ($conn->WebSocket->established) { - $this->component->onError($this->connections[$conn], $e); + if ($this->connections->contains($conn)) { + $this->component->onError($this->connections[$conn], $e); + } } else { $conn->close(); }