mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Bluetooth: don't crash if BT is turned off
At least on a Mac we can get here without a discoveryAgent if BT is off, so don't derefence the NULL pointer in that case. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
21c81d5b87
commit
2f9bf92a17
1 changed files with 6 additions and 0 deletions
|
@ -316,6 +316,12 @@ bool BTDiscovery::checkException(const char* method, const QAndroidJniObject *ob
|
||||||
|
|
||||||
void BTDiscovery::discoverAddress(QString address)
|
void BTDiscovery::discoverAddress(QString address)
|
||||||
{
|
{
|
||||||
|
// if we have a discovery agent, check if we know about the address and if not
|
||||||
|
// make sure we are looking for it
|
||||||
|
// (if we don't have a discoveryAgent then likely BT is off or something else went wrong)
|
||||||
|
if (!discoveryAgent)
|
||||||
|
return;
|
||||||
|
|
||||||
// let's make sure there is no device name mixed in with the address
|
// let's make sure there is no device name mixed in with the address
|
||||||
QString btAddress;
|
QString btAddress;
|
||||||
btAddress = extractBluetoothAddress(address);
|
btAddress = extractBluetoothAddress(address);
|
||||||
|
|
Loading…
Add table
Reference in a new issue