summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/location/maps/qgeoserviceprovider.cpp11
-rw-r--r--src/location/maps/qgeoserviceprovider.h3
2 files changed, 12 insertions, 2 deletions
diff --git a/src/location/maps/qgeoserviceprovider.cpp b/src/location/maps/qgeoserviceprovider.cpp
index 11b1c28d..c6b9d742 100644
--- a/src/location/maps/qgeoserviceprovider.cpp
+++ b/src/location/maps/qgeoserviceprovider.cpp
@@ -534,9 +534,13 @@ QPlaceManager *QGeoServiceProvider::placeManager() const
*/
QNavigationManager *QGeoServiceProvider::navigationManager() const
{
- return d_ptr->manager<QNavigationManager, QNavigationManagerEngine>(
+ QNavigationManager * mgr = d_ptr->manager<QNavigationManager, QNavigationManagerEngine>(
&(d_ptr->navigationError), &(d_ptr->navigationErrorString),
&(d_ptr->navigationManager));
+ if (!mgr) {
+ qDebug() << d_ptr->navigationError << d_ptr->navigationErrorString;
+ }
+ return mgr;
}
/*!
@@ -747,6 +751,11 @@ void QGeoServiceProviderPrivate::loadPlugin(const QVariantMap &parameters)
// load the actual plugin
QObject *instance = loader()->instance(idx);
+ if (!instance) {
+ error = QGeoServiceProvider::LoaderError;
+ errorString = QLatin1String("loader()->instance(idx) failed to return an instance");
+ return;
+ }
factoryV3 = qobject_cast<QGeoServiceProviderFactoryV3 *>(instance);
if (!factoryV3) {
factoryV2 = qobject_cast<QGeoServiceProviderFactoryV2 *>(instance);
diff --git a/src/location/maps/qgeoserviceprovider.h b/src/location/maps/qgeoserviceprovider.h
index 8e594977..b2e0be05 100644
--- a/src/location/maps/qgeoserviceprovider.h
+++ b/src/location/maps/qgeoserviceprovider.h
@@ -69,7 +69,8 @@ public:
NotSupportedError,
UnknownParameterError,
MissingRequiredParameterError,
- ConnectionError
+ ConnectionError,
+ LoaderError
};
enum RoutingFeature {