mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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
1 changed files with 4 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue