diff --git a/nel/src/net/sock.cpp b/nel/src/net/sock.cpp index f9a6b61fa3..410c33e621 100644 --- a/nel/src/net/sock.cpp +++ b/nel/src/net/sock.cpp @@ -524,6 +524,9 @@ void CSock::connect(const CInetHost &addrs) */ bool CSock::dataAvailable() { + if (_Sock == INVALID_SOCKET) + throw ESocket("CSock::dataAvailable(): invalid socket"); + fd_set fdset; FD_ZERO( &fdset ); FD_SET( _Sock, &fdset );