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

pull/23506/head
Dean Lee 2022-02-04 07:33:29 +08:00 committed by GitHub
parent 4715510e91
commit 4e0c08c0a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

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) {