summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2017-02-28 14:12:23 +0100
committerPaolo Angelelli <paolo.angelelli@qt.io>2017-02-28 13:19:55 +0000
commita1c8a23c52087300ffd7bf7e61bdfaab8ff6ecc9 (patch)
tree50e46a60ccc48b76a7420a37f2a98ff0f8c60026
parent2521e5fe81a4b1f2d5b0819ef4c7f239c8fc55b9 (diff)
Fix null pointer exception
This patch fixes a null pointer exception happening when the application starts without network and then the network becomes available Change-Id: Iedeacf8fb8f350dfa92c05c1d2e16f62199ca5fd Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
-rw-r--r--src/plugins/geoservices/osm/qgeotileproviderosm.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/geoservices/osm/qgeotileproviderosm.cpp b/src/plugins/geoservices/osm/qgeotileproviderosm.cpp
index 1989c44f..0d617368 100644
--- a/src/plugins/geoservices/osm/qgeotileproviderosm.cpp
+++ b/src/plugins/geoservices/osm/qgeotileproviderosm.cpp
@@ -183,7 +183,7 @@ void QGeoTileProviderOsm::onResolutionError(TileProvider *provider)
{
Q_UNUSED(provider)
// provider and m_provider are the same at this point. m_status is Resolving.
- if (m_provider->isInvalid()) {
+ if (!m_provider || m_provider->isInvalid()) {
m_provider = nullptr;
m_status = Resolved;
if (m_providerId >= m_providerList.size() -1) { // no hope left