From 4e0c08c0a6b700d2532e80e6c35e208fca86c5b6 Mon Sep 17 00:00:00 2001 From: Dean Lee Date: Fri, 4 Feb 2022 07:33:29 +0800 Subject: [PATCH] WifiManager: fix crash if no wifi device found (#23701) --- selfdrive/ui/qt/offroad/wifiManager.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/selfdrive/ui/qt/offroad/wifiManager.cc b/selfdrive/ui/qt/offroad/wifiManager.cc index 2e674bb205..32ff0918ef 100644 --- a/selfdrive/ui/qt/offroad/wifiManager.cc +++ b/selfdrive/ui/qt/offroad/wifiManager.cc @@ -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) {