sdm660-common: gps: Add NULL check before object access

Correct the NULL check code block and add NULL check before
object access.

Change-Id: Ic41b781b41fb4e21bbff8801d500a41a6d7219d0
CRs-fixed: 3084543
This commit is contained in:
Madhanraj Chelladurai 2023-09-06 00:07:26 +08:00 committed by CakesTwix
parent eaab2ad176
commit d88a67c4c7
Signed by: CakesTwix
GPG key ID: 7B11051D5CE19825

View file

@ -194,7 +194,9 @@ BatteryListenerImpl::~BatteryListenerImpl()
}
}
mDone = true;
if (NULL != mThread) {
mThread->join();
}
}
void BatteryListenerImpl::serviceDied(uint64_t cookie __unused,
@ -211,7 +213,9 @@ void BatteryListenerImpl::serviceDied(uint64_t cookie __unused,
}
mHealth = NULL;
mCond.notify_one();
if (NULL != mThread) {
mThread->join();
}
std::lock_guard<std::mutex> _l(mLock);
init();
}