Fix crash at gnss bugreport caused by empty report
Adding an empty check for gnss time information before generating a gnss bugreport to avoid null object access. Bug: 37259715 Change-Id: Ic507acbcc8b5949c4304ad76a3032add5893d099 CRs-Fixed: 2032932
This commit is contained in:
parent
f3a58cea24
commit
3b9f65652b
1 changed files with 5 additions and 3 deletions
|
@ -2691,10 +2691,12 @@ bool GnssAdapter::getDebugReport(GnssDebugReport& r)
|
||||||
r.mLocation.mLocation.speed);
|
r.mLocation.mLocation.speed);
|
||||||
|
|
||||||
// time block
|
// time block
|
||||||
|
r.mTime.size = sizeof(r.mTime);
|
||||||
if(!reports.mBestPosition.empty()) {
|
if(!reports.mBestPosition.empty()) {
|
||||||
r.mTime.size = sizeof(r.mTime);
|
r.mTime.timeEstimate = reports.mBestPosition.back().mUtcTime.tv_sec;
|
||||||
r.mTime.timeEstimate = reports.mBestPosition.back().mUtcTime.tv_sec;
|
}
|
||||||
r.mTime.timeUncertaintyNs = (float)(reports.mTimeAndClock.back().mTimeUnc);
|
if(!reports.mTimeAndClock.empty()) {
|
||||||
|
r.mTime.timeUncertaintyNs = (float)(reports.mTimeAndClock.back().mTimeUnc);
|
||||||
}
|
}
|
||||||
LOC_LOGV("getDebugReport - timeestimate=%lld", r.mTime.timeEstimate);
|
LOC_LOGV("getDebugReport - timeestimate=%lld", r.mTime.timeEstimate);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue