diff --git a/dom/bluetooth/BluetoothService.cpp b/dom/bluetooth/BluetoothService.cpp index e446388ee08d..1f2253bd41f2 100644 --- a/dom/bluetooth/BluetoothService.cpp +++ b/dom/bluetooth/BluetoothService.cpp @@ -40,9 +40,11 @@ public: MOZ_ASSERT(NS_IsMainThread()); if (!mEnabled || gInShutdown) { - nsCOMPtr t; - gBluetoothService->mBluetoothCommandThread.swap(t); - t->Shutdown(); + if (gBluetoothService->mBluetoothCommandThread) { + nsCOMPtr t; + gBluetoothService->mBluetoothCommandThread.swap(t); + t->Shutdown(); + } } if (gInShutdown) {