Do not try to connect to null object if bearer plugin is missing

Warning about connecting to null object was printed when bearer plugin
is missing when bearer management feature is enabled.

Change-Id: Iac33081c5f301862c066eb69ec05ff6d95775c09
Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
bb10
Joni Poikelin 2015-11-17 08:24:57 +02:00
parent b13801fd55
commit 28beaf63cd
1 changed files with 4 additions and 2 deletions

View File

@ -127,8 +127,10 @@ void QNetworkReplyImplPrivate::_q_startOperation()
return;
} 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
}