fix potential crash in GPS code
If we don't have a GpsLocation instance, we shouldn't dereference it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
3a65b0f37f
commit
2a579987c2
@ -11,7 +11,10 @@ GpsListModel::GpsListModel()
|
||||
|
||||
void GpsListModel::update()
|
||||
{
|
||||
QVector<gpsTracker> trackers = QVector<gpsTracker>::fromList(GpsLocation::instance()->currentGPSInfo().values());
|
||||
GpsLocation *glp = GpsLocation::instance();
|
||||
if (!glp)
|
||||
return;
|
||||
QVector<gpsTracker> trackers = QVector<gpsTracker>::fromList(glp->currentGPSInfo().values());
|
||||
beginResetModel();
|
||||
m_gpsFixes = trackers;
|
||||
endResetModel();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user