summaryrefslogtreecommitdiffstats
path: root/tdecore/tdehw/tdenetworkconnections.cpp
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:30:28 +0200
commitfbc18041963c06602b6c1d82fabdd8e6fc05dbda (patch)
tree544be13cf6f0457ef2d5eb37f5e596bf34b3436e /tdecore/tdehw/tdenetworkconnections.cpp
parent86a973eba279777a540d120278db6d88b824d6fe (diff)
downloadtdelibs-fbc18041963c06602b6c1d82fabdd8e6fc05dbda.tar.gz
tdelibs-fbc18041963c06602b6c1d82fabdd8e6fc05dbda.zip
tdehwlib: Prevent potential crash, when building without Network Manager support.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit 2b3ea27bdf4879933d46aba24c457382398c998f)
Diffstat (limited to 'tdecore/tdehw/tdenetworkconnections.cpp')
-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 7cef67cf3..d525185a3 100644
--- a/tdecore/tdehw/tdenetworkconnections.cpp
+++ b/tdecore/tdehw/tdenetworkconnections.cpp
@@ -1097,9 +1097,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;
+ }
}
}
}