mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
Nearby Connections - Fixed crash when starting the app on devices with no Bluetooth adapter
PiperOrigin-RevId: 441773811
This commit is contained in:
committed by
Copybara-Service
parent
d1b2437b0d
commit
3f81504dc1
@@ -123,6 +123,14 @@ Exception BluetoothServerSocket::StartListening(bool radioDiscoverable) {
|
||||
|
||||
LeaveCriticalSection(&critical_section_);
|
||||
|
||||
return {Exception::kFailed};
|
||||
} catch (const winrt::hresult_error& ex) {
|
||||
NEARBY_LOGS(ERROR) << __func__
|
||||
<< ": Exception setting up for listen: " << ex.code()
|
||||
<< ": " << winrt::to_string(ex.message());
|
||||
|
||||
LeaveCriticalSection(&critical_section_);
|
||||
|
||||
return {Exception::kFailed};
|
||||
}
|
||||
|
||||
@@ -145,6 +153,14 @@ Exception BluetoothServerSocket::StartAdvertising() {
|
||||
|
||||
LeaveCriticalSection(&critical_section_);
|
||||
|
||||
return {Exception::kFailed};
|
||||
} catch (const winrt::hresult_error& ex) {
|
||||
NEARBY_LOGS(ERROR) << __func__
|
||||
<< ": Exception calling StartAdvertising: " << ex.code()
|
||||
<< ": " << winrt::to_string(ex.message());
|
||||
|
||||
LeaveCriticalSection(&critical_section_);
|
||||
|
||||
return {Exception::kFailed};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user