| Index: device/bluetooth/bluetooth_discovery_session.cc
|
| diff --git a/device/bluetooth/bluetooth_discovery_session.cc b/device/bluetooth/bluetooth_discovery_session.cc
|
| index 076123e3ad8f97c08461aead83370581cf8bed54..355bdf63da5132fe95025aaec39d28c16c9ce432 100644
|
| --- a/device/bluetooth/bluetooth_discovery_session.cc
|
| +++ b/device/bluetooth/bluetooth_discovery_session.cc
|
| @@ -23,9 +23,11 @@ BluetoothDiscoverySession::BluetoothDiscoverySession()
|
| }
|
|
|
| BluetoothDiscoverySession::~BluetoothDiscoverySession() {
|
| - if (!active_)
|
| + // |adapter_| may be NULL if this instance was initialized as a mock.
|
| + if (!adapter_.get()) {
|
| + DCHECK(!active_);
|
| return;
|
| - DCHECK(adapter_.get());
|
| + }
|
| Stop(base::Bind(&base::DoNothing), base::Bind(&base::DoNothing));
|
| adapter_->DiscoverySessionDestroyed(this);
|
| }
|
|
|