From a1c8a23c52087300ffd7bf7e61bdfaab8ff6ecc9 Mon Sep 17 00:00:00 2001 From: Paolo Angelelli Date: Tue, 28 Feb 2017 14:12:23 +0100 Subject: 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 --- src/plugins/geoservices/osm/qgeotileproviderosm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/geoservices/osm') 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 -- cgit v1.2.1