[Connectivity Report] Fixed crash if signalStrengths is empty.

BUG: 449276
This commit is contained in:
Michael Prager 2022-03-04 03:49:34 +01:00 committed by Albert Vaca Cintora
parent 19b8249ed1
commit ef0efc360f

View file

@ -41,6 +41,7 @@ bool ConnectivityReportPlugin::receivePacket(const NetworkPacket& np)
{
if (np.type() == PACKET_TYPE_CONNECTIVITY_REPORT) {
auto subscriptions = np.get<QVariantMap>(QStringLiteral("signalStrengths"), QVariantMap());
if (!subscriptions.isEmpty()) {
auto networkInfo = subscriptions.first().toMap();
const auto oldCellularNetworkType = m_cellularNetworkType;
@ -54,6 +55,7 @@ bool ConnectivityReportPlugin::receivePacket(const NetworkPacket& np)
Q_EMIT refreshed(m_cellularNetworkType, m_cellularNetworkStrength);
}
}
}
return true;
}