From 949c9eb9af8d0cdcd4fe5ec99c15bb78a4da1e4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E6=9C=8B=E7=A8=8B?= Date: Tue, 13 Dec 2022 17:15:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=8F=8D=E5=A4=8D?= =?UTF-8?q?=E5=BC=80=E5=85=B3=E8=93=9D=E7=89=99=E5=AF=BC=E8=87=B4=E7=9A=84?= =?UTF-8?q?=E5=B4=A9=E6=BA=83=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 野指针问题 Log: 修复反复开关蓝牙导致的崩溃问题 Influence: 蓝牙开关功能 Task: https://pms.uniontech.com/task-view-226123.html Change-Id: Id6c495ffa24aebbb15ad0bac8cdc5ed9aeef8f54 --- plugins/bluetooth/componments/bluetoothadapteritem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/bluetooth/componments/bluetoothadapteritem.cpp b/plugins/bluetooth/componments/bluetoothadapteritem.cpp index 697d5c21e..4b3f7584e 100644 --- a/plugins/bluetooth/componments/bluetoothadapteritem.cpp +++ b/plugins/bluetooth/componments/bluetoothadapteritem.cpp @@ -274,7 +274,7 @@ void BluetoothAdapterItem::onDeviceAdded(const Device *device) void BluetoothAdapterItem::onDeviceRemoved(const Device *device) { - if (m_deviceItems.isEmpty()) + if (m_deviceItems.isEmpty() || !m_deviceItems.keys().contains(device->id())) return; m_deviceModel->removeRow(m_deviceItems.value(device->id())->standardItem()->row());