Skip to content

Commit

Permalink
fix crash when gps source is not available (e.g. missing QT plugins)
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterPetrik committed Nov 18, 2019
1 parent 65182a2 commit 90cbcc9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/quickgui/qgsquickpositionkit.cpp
Expand Up @@ -39,7 +39,7 @@ QGeoPositionInfoSource *QgsQuickPositionKit::gpsSource()
// this should give us "true" position source
// on Linux it comes from Geoclue library
std::unique_ptr<QGeoPositionInfoSource> source( QGeoPositionInfoSource::createDefaultSource( nullptr ) );
if ( source->error() != QGeoPositionInfoSource::NoError )
if ( ( !source ) || ( source->error() != QGeoPositionInfoSource::NoError ) )
{
QgsMessageLog::logMessage( QStringLiteral( "%1 (%2)" )
.arg( tr( "Unable to create default GPS Position Source" ) )
Expand Down

0 comments on commit 90cbcc9

Please sign in to comment.