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>
bb10
Andy Shaw 2015-10-22 10:29:18 +02:00
parent 95b1982e47
commit a91c40868b
1 changed files with 3 additions and 2 deletions

View File

@ -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
}