summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--louloulibs/network/tcp_socket_handler.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/louloulibs/network/tcp_socket_handler.cpp b/louloulibs/network/tcp_socket_handler.cpp
index d5c0dfa..78efdce 100644
--- a/louloulibs/network/tcp_socket_handler.cpp
+++ b/louloulibs/network/tcp_socket_handler.cpp
@@ -410,7 +410,9 @@ void TCPSocketHandler::tls_recv()
void TCPSocketHandler::tls_send(std::string&& data)
{
- if (this->tls->is_active())
+ // We may not be connected yet, or the tls session has
+ // not yet been negociated
+ if (this->tls && this->tls->is_active())
{
const bool was_active = this->tls->is_active();
if (!this->pre_buf.empty())