summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@theqtcompany.com>2015-09-23 13:09:18 +0200
committerChristian Kandeler <christian.kandeler@theqtcompany.com>2015-09-23 11:38:05 +0000
commitcaef6445a95dd1941fdf583f09407e1e32b11249 (patch)
treecd3a9bfdc8d88a87738b8cb26755cab45e247554 /examples
parentb88f167840b0449aa130fc81ee8ee8e2caf028fe (diff)
Bluetooth: Fix crash in btscanner example.
Task-number: QTBUG-47773 Change-Id: Ie76345ded1292c6c62eae5f3beddd48cd9e0ae22 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/bluetooth/btscanner/device.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/examples/bluetooth/btscanner/device.cpp b/examples/bluetooth/btscanner/device.cpp
index 910791fb..3d8a98dc 100644
--- a/examples/bluetooth/btscanner/device.cpp
+++ b/examples/bluetooth/btscanner/device.cpp
@@ -181,6 +181,8 @@ void DeviceDiscoveryDialog::hostModeStateChanged(QBluetoothLocalDevice::HostMode
}
void DeviceDiscoveryDialog::displayPairingMenu(const QPoint &pos)
{
+ if (ui->list->count() == 0)
+ return;
QMenu menu(this);
QAction *pairAction = menu.addAction("Pair");
QAction *removePairAction = menu.addAction("Remove Pairing");