From 890e3ca5775960d250c792c4d9e17f8d70dbb165 Mon Sep 17 00:00:00 2001 From: jzxc95 <907297917@qq.com> Date: Tue, 26 Sep 2023 16:01:46 +0800 Subject: [PATCH] =?UTF-8?q?fix(hotspot):=E6=97=A0=E7=BA=BF=E7=BD=91?= =?UTF-8?q?=E5=8D=A1=E7=83=AD=E7=82=B9=E8=83=BD=E5=8A=9B=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E4=BF=AE=E6=94=B9(#195043)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/dbus-interface/kylinnetworkdeviceresource.cpp | 2 +- src/backend/dbus-interface/kywirelessnetresource.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/backend/dbus-interface/kylinnetworkdeviceresource.cpp b/src/backend/dbus-interface/kylinnetworkdeviceresource.cpp index eb8cc2c4..8509f287 100644 --- a/src/backend/dbus-interface/kylinnetworkdeviceresource.cpp +++ b/src/backend/dbus-interface/kylinnetworkdeviceresource.cpp @@ -453,7 +453,7 @@ int KyNetworkDeviceResourse::getWirelessDeviceCapability(const QString deviceNam qobject_cast(connectDevice.data()); int cap = 0x00; - if (wirelessDevicePtr->wirelessCapabilities() & NetworkManager::WirelessDevice::AdhocCap) { + if (wirelessDevicePtr->wirelessCapabilities() & NetworkManager::WirelessDevice::ApCap) { cap = cap | 0x02; } else { return 0x01; diff --git a/src/backend/dbus-interface/kywirelessnetresource.cpp b/src/backend/dbus-interface/kywirelessnetresource.cpp index 6196d55c..fc020d68 100644 --- a/src/backend/dbus-interface/kywirelessnetresource.cpp +++ b/src/backend/dbus-interface/kywirelessnetresource.cpp @@ -295,6 +295,10 @@ QString KyWirelessNetResource::getDeviceIFace(NetworkManager::ActiveConnection:: NetworkManager::Device:: Ptr devicePtr = m_networkResourceInstance->findDeviceUni(ifaceUni); + if (devicePtr.isNull()) { + return QString(); + } + return devicePtr->interfaceName(); }