example 'meshtastic': fix possible BLE crash

This commit is contained in:
pls.153 2024-06-03 17:47:40 +02:00
parent 29356f5142
commit 21e46841ef

View file

@ -136,12 +136,14 @@ void BLE::addLowEnergyService(const QBluetoothUuid& serviceUuid) {
}
void BLE::serviceScanDone() {
scanned = true;
Q_EMIT mainServiceReady();
qDebug() << "service scan done";
if (mainService != nullptr) {
scanned = true;
Q_EMIT mainServiceReady();
qDebug() << "service scan done";
#if QT_VERSION >= 0x060000
qDebug() << "MTU:" << controller->mtu();
qDebug() << "MTU:" << controller->mtu();
#endif
}
}
void BLE::connectToService(const QString& uuid) {