mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-14 22:56:12 -04:00
Fix bluetooth adapter null pointer exception
PiperOrigin-RevId: 568994552
This commit is contained in:
committed by
Copybara-Service
parent
d095f505d3
commit
eba928e784
@@ -221,7 +221,12 @@ bool BleGattServer::InitializeGattServer() {
|
||||
NEARBY_LOGS(VERBOSE) << __func__ << ": Create GATT service service_uuid="
|
||||
<< std::string(service_uuid_);
|
||||
|
||||
if (adapter_ == nullptr || !adapter_->IsEnabled()) {
|
||||
if (adapter_ == nullptr) {
|
||||
NEARBY_LOGS(ERROR) << __func__ << ": Bluetooth adapter is absent.";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!adapter_->IsEnabled()) {
|
||||
NEARBY_LOGS(ERROR) << __func__ << ": Bluetooth adapter is disabled.";
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user