summaryrefslogtreecommitdiffstats
path: root/src/network/access/qnetworkreplyhttpimpl.cpp
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@theqtcompany.com>2015-10-22 10:29:18 +0200
committerAndy Shaw <andy.shaw@theqtcompany.com>2015-10-27 18:00:22 +0000
commita91c40868bbdc1b2d2dd3b5f8b47aae9e8589a81 (patch)
treee4c8531e442ca94a437e8766f8d0eb489be1cace /src/network/access/qnetworkreplyhttpimpl.cpp
parent95b1982e4779160a42000661986a31aab6bafbb5 (diff)
Check if the session is valid before connecting to it
Since there are circumstances where the session is not yet created after start() is called then we should check if the session is valid before connecting to it. Change-Id: I94236f76e4be2433a8c96eb91ce2d4b4d42f2fd9 Reviewed-by: Richard J. Moore <rich@kde.org>
Diffstat (limited to 'src/network/access/qnetworkreplyhttpimpl.cpp')
-rw-r--r--src/network/access/qnetworkreplyhttpimpl.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/network/access/qnetworkreplyhttpimpl.cpp b/src/network/access/qnetworkreplyhttpimpl.cpp
index c1956ae99f..76c2f57380 100644
--- a/src/network/access/qnetworkreplyhttpimpl.cpp
+++ b/src/network/access/qnetworkreplyhttpimpl.cpp
@@ -1679,8 +1679,9 @@ void QNetworkReplyHttpImplPrivate::_q_startOperation()
#endif
} else {
#ifndef QT_NO_BEARERMANAGEMENT
- QObject::connect(session.data(), SIGNAL(stateChanged(QNetworkSession::State)),
- q, SLOT(_q_networkSessionStateChanged(QNetworkSession::State)), Qt::QueuedConnection);
+ if (session)
+ QObject::connect(session.data(), SIGNAL(stateChanged(QNetworkSession::State)),
+ q, SLOT(_q_networkSessionStateChanged(QNetworkSession::State)), Qt::QueuedConnection);
#endif
}