Test for connection attachement before cascading error

This commit is contained in:
Florian Rey 2013-10-10 13:40:26 +02:00
parent 2206a9fc83
commit f40bb94a92

View File

@ -150,7 +150,9 @@ class WsServer implements HttpServerInterface {
*/ */
public function onError(ConnectionInterface $conn, \Exception $e) { public function onError(ConnectionInterface $conn, \Exception $e) {
if ($conn->WebSocket->established) { if ($conn->WebSocket->established) {
$this->component->onError($this->connections[$conn], $e); if ($this->connections->contains($conn)) {
$this->component->onError($this->connections[$conn], $e);
}
} else { } else {
$conn->close(); $conn->close();
} }