QNetworkConnectionEvents: fix potential nullptr access
Fix potential nullptr access in QNetworkConnectionEvents::getNetworkConnectionFromAdapterGuid(). This can happen if for some reason the NetworkListManager instance failed to be instantiated in QNetworkConnectionEvents constructor. Fixes: QTBUG-117097 Pick-to: 6.6 6.5 Change-Id: If51ea383e22461a6c3124576c4e1be3f30dde1f6 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>bb10
parent
1e25bf5f4d
commit
6b4cc9bf73
|
|
@ -167,6 +167,12 @@ QNetworkConnectionEvents::~QNetworkConnectionEvents()
|
|||
|
||||
ComPtr<INetworkConnection> QNetworkConnectionEvents::getNetworkConnectionFromAdapterGuid(QUuid guid)
|
||||
{
|
||||
if (!networkListManager) {
|
||||
qCDebug(lcNetMon) << "Failed to enumerate network connections:"
|
||||
<< "NetworkListManager was not instantiated";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ComPtr<IEnumNetworkConnections> connections;
|
||||
auto hr = networkListManager->GetNetworkConnections(connections.GetAddressOf());
|
||||
if (FAILED(hr)) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue