Bug 976537 - Guard against crashing in NFC shutdown when sNfcConsumer is NULL. r=allstars.chh

This commit is contained in:
Douglas Crosher 2014-02-26 00:54:54 +11:00
parent 16b735cedc
commit 71972c4eb2

View File

@ -311,9 +311,11 @@ NfcConsumer::Shutdown()
{
MOZ_ASSERT(NS_IsMainThread());
sNfcConsumer->mShutdown = true;
sNfcConsumer->CloseSocket();
sNfcConsumer = nullptr;
if (sNfcConsumer) {
sNfcConsumer->mShutdown = true;
sNfcConsumer->CloseSocket();
sNfcConsumer = nullptr;
}
}
void