diff options
author | Paolo Angelelli <paolo.angelelli@qt.io> | 2018-02-12 19:11:38 +0100 |
---|---|---|
committer | Paolo Angelelli <paolo.angelelli@qt.io> | 2018-02-19 16:21:17 +0000 |
commit | e09d0e9351e237ad6c9d417c20a24469df743eca (patch) | |
tree | 0613af8e21ff5e054b9d61c7d0d8438ac654c79c | |
parent | 492cb3e14d3c67173eb1e6d37c9b3a44f4d7467d (diff) |
Fix crash calling Map.clearMapItems before Map is initialized
Task-number: QTBUG-66315
Change-Id: I18af392a00303b3b4c515c8f557e9c3fa09657eb
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
-rw-r--r-- | src/location/declarativemaps/qdeclarativegeomap.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/location/declarativemaps/qdeclarativegeomap.cpp b/src/location/declarativemaps/qdeclarativegeomap.cpp index 5c916fb2..57f127ef 100644 --- a/src/location/declarativemaps/qdeclarativegeomap.cpp +++ b/src/location/declarativemaps/qdeclarativegeomap.cpp @@ -2006,9 +2006,10 @@ void QDeclarativeGeoMap::removeMapItem(QDeclarativeGeoMapItemBase *ptr) */ void QDeclarativeGeoMap::clearMapItems() { - m_map->clearMapItems(); if (m_mapItems.isEmpty()) return; + if (m_map) + m_map->clearMapItems(); for (auto i : qAsConst(m_mapItems)) { if (i) { i->setMap(0, 0); |