mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 774708: Ensure sBluetoothEventObserverTable is valid before attempting to query observers, fixing a Bluetooth crash in emulator. r=qDot
This commit is contained in:
parent
82d9434006
commit
b9d7c4b96d
@ -75,6 +75,8 @@ RegisterBluetoothEventHandler(const nsCString& aNodeName,
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
BluetoothEventObserverList *ol;
|
||||
|
||||
NS_ENSURE_TRUE(sBluetoothEventObserverTable, NS_ERROR_FAILURE);
|
||||
if (!sBluetoothEventObserverTable->Get(aNodeName, &ol)) {
|
||||
sBluetoothEventObserverTable->Put(aNodeName,
|
||||
new BluetoothEventObserverList());
|
||||
@ -90,6 +92,8 @@ UnregisterBluetoothEventHandler(const nsCString& aNodeName,
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
BluetoothEventObserverList *ol;
|
||||
|
||||
NS_ENSURE_TRUE(sBluetoothEventObserverTable, NS_ERROR_FAILURE);
|
||||
if (!sBluetoothEventObserverTable->Get(aNodeName, &ol)) {
|
||||
NS_WARNING("Node does not exist to remove BluetoothEventListener from!");
|
||||
return NS_ERROR_FAILURE;
|
||||
|
Loading…
Reference in New Issue
Block a user