From 634718d6b41be6577fc6948f35b0c108ee86f942 Mon Sep 17 00:00:00 2001 From: "Francisco Blas (klondike) Izquierdo Riera" Date: Tue, 6 Jan 2015 23:51:10 +0100 Subject: [PATCH] Detect null stream on I2PConnect --- I2PTunnel.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/I2PTunnel.cpp b/I2PTunnel.cpp index e003f7e9..b782a657 100644 --- a/I2PTunnel.cpp +++ b/I2PTunnel.cpp @@ -1,3 +1,4 @@ +#include #include "base64.h" #include "Log.h" #include "Destination.h" @@ -36,10 +37,13 @@ namespace client void I2PTunnelConnection::I2PConnect (const uint8_t * msg, size_t len) { - if (msg) - m_Stream->Send (msg, len); // connect and send - else - m_Stream->Send (m_Buffer, 0); // connect + if (m_Stream) + { + if (msg) + m_Stream->Send (msg, len); // connect and send + else + m_Stream->Send (m_Buffer, 0); // connect + } StreamReceive (); Receive (); }