summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2021-09-30 04:10:22 +0200
committerSlávek Banko <slavek.banko@axis.cz>2021-09-30 04:10:22 +0200
commit2b3ea27bdf4879933d46aba24c457382398c998f (patch)
tree4bd2162b6fed94d7e33378d267dac744e5d11c96
parentf159fa61a972641944adc614d33baf5e52ac5e0e (diff)
downloadtdelibs-2b3ea27bdf4879933d46aba24c457382398c998f.tar.gz
tdelibs-2b3ea27bdf4879933d46aba24c457382398c998f.zip
tdehwlib: Prevent potential crash, when building without Network Manager support.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-rw-r--r--tdecore/tdehw/tdenetworkconnections.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/tdecore/tdehw/tdenetworkconnections.cpp b/tdecore/tdehw/tdenetworkconnections.cpp
index 0cf1823a..0b6405ea 100644
--- a/tdecore/tdehw/tdenetworkconnections.cpp
+++ b/tdecore/tdehw/tdenetworkconnections.cpp
@@ -1104,9 +1104,14 @@ TDENetworkWiFiAPInfo* TDEGlobalNetworkManager::findAccessPointByBSSID(TDEMACAddr
TDENetworkDevice* dev = dynamic_cast<TDENetworkDevice*>(*it);
if (dev) {
TDENetworkConnectionManager* deviceConnMan = dev->connectionManager();
- TDENetworkWiFiAPInfo* candidate = deviceConnMan->findAccessPointByBSSID(bssid);
- if (candidate) {
- ret = candidate;
+ if (deviceConnMan)
+ {
+ TDENetworkWiFiAPInfo* candidate = deviceConnMan->findAccessPointByBSSID(bssid);
+ if (candidate)
+ {
+ ret = candidate;
+ break;
+ }
}
}
}