diff options
| author | Joshua Vandaƫle <joshua@vandaele.software> | 2025-06-09 15:30:26 +0200 |
|---|---|---|
| committer | Joshua Vandaƫle <joshua@vandaele.software> | 2025-07-12 12:47:30 +0200 |
| commit | 06882bd2dca4ea92d0608077c45cff6cb7e41583 (patch) | |
| tree | c20781479b42392bea8ba2169d0e123e9a98d0c3 /Source/Core/DolphinQt/Config/WiimoteControllersWidget.cpp | |
| parent | f76ab863266d012281e52bceda355bc72f36edb8 (diff) | |
Fix various warnings
Diffstat (limited to 'Source/Core/DolphinQt/Config/WiimoteControllersWidget.cpp')
| -rw-r--r-- | Source/Core/DolphinQt/Config/WiimoteControllersWidget.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Source/Core/DolphinQt/Config/WiimoteControllersWidget.cpp b/Source/Core/DolphinQt/Config/WiimoteControllersWidget.cpp index ef6989ad9b..11c98ee883 100644 --- a/Source/Core/DolphinQt/Config/WiimoteControllersWidget.cpp +++ b/Source/Core/DolphinQt/Config/WiimoteControllersWidget.cpp @@ -309,8 +309,15 @@ void WiimoteControllersWidget::OnBluetoothPassthroughDeviceChanged(int index) return; } - auto device_info = - m_bluetooth_adapters->itemData(index).value<LibUSBBluetoothAdapter::BluetoothDeviceInfo>(); + const QVariant item_data = m_bluetooth_adapters->itemData(index); + + if (!item_data.isValid() || !item_data.canConvert<LibUSBBluetoothAdapter::BluetoothDeviceInfo>()) + { + ERROR_LOG_FMT(COMMON, "Invalid Bluetooth device info selected in WiimoteControllersWidget"); + return; + } + + const auto& device_info = item_data.value<LibUSBBluetoothAdapter::BluetoothDeviceInfo>(); Config::SetBaseOrCurrent(Config::MAIN_BLUETOOTH_PASSTHROUGH_PID, device_info.pid); Config::SetBaseOrCurrent(Config::MAIN_BLUETOOTH_PASSTHROUGH_VID, device_info.vid); |
