WifiManager: fix crash if no wifi device found (#23701)

old-commit-hash: 4e0c08c0a6b700d2532e80e6c35e208fca86c5b6
This commit is contained in:
Dean Lee
2022-02-04 07:33:29 +08:00
committed by GitHub
parent e2b296f0ae
commit d76c70cb2f

View File

@@ -226,7 +226,9 @@ uint WifiManager::getAdapterType(const QDBusObjectPath &path) {
}
void WifiManager::requestScan() {
asyncCall(adapter, NM_DBUS_INTERFACE_DEVICE_WIRELESS, "RequestScan", QVariantMap());
if (!adapter.isEmpty()) {
asyncCall(adapter, NM_DBUS_INTERFACE_DEVICE_WIRELESS, "RequestScan", QVariantMap());
}
}
QByteArray WifiManager::get_property(const QString &network_path , const QString &property) {