mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
[Nearby Presence] Check IsValid() before accessing impl_
Adding a check to `IsInvalid()` before accessing `impl_` in `Blev2Medium::IsExtendedAdvertisementsAvailable()` to prevent a crash when `impl_` is nullptr (which occurs when BleV2 is disabled). PiperOrigin-RevId: 635854690
This commit is contained in:
committed by
Copybara-Service
parent
4472598508
commit
84bb5700c4
@@ -224,7 +224,7 @@ BleV2Socket BleV2Medium::Connect(const std::string& service_id,
|
||||
}
|
||||
|
||||
bool BleV2Medium::IsExtendedAdvertisementsAvailable() {
|
||||
return impl_->IsExtendedAdvertisementsAvailable();
|
||||
return IsValid() && impl_->IsExtendedAdvertisementsAvailable();
|
||||
}
|
||||
|
||||
BleV2Peripheral BleV2Medium::GetRemotePeripheral(
|
||||
|
||||
Reference in New Issue
Block a user