summaryrefslogtreecommitdiff
path: root/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2017-03-22 12:18:39 +0100
committerPaolo Angelelli <paolo.angelelli@qt.io>2017-03-27 11:22:37 +0000
commite924f737a6f28792a682f0dcce63a5442cdd43ce (patch)
tree63aba87db6d545ceb193a8c7cb4a0fe5ada72729 /src/location/declarativemaps/qdeclarativepolygonmapitem.cpp
parent67ae01ab1ac3db9f33929c49349506a7f2f26c2b (diff)
downloadqtlocation-e924f737a6f28792a682f0dcce63a5442cdd43ce.tar.gz
Check for map in map item's geometryChanged
Add additional sanity checks to do the geometry changing only if the map() has been set already (that is, the item has been added to the map) Change-Id: Id5b5faa41c68c80c3ad322f408b7a8abe5d2f7ab Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/location/declarativemaps/qdeclarativepolygonmapitem.cpp')
-rw-r--r--src/location/declarativemaps/qdeclarativepolygonmapitem.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp b/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp
index 44d1787f..5cd57dcb 100644
--- a/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp
+++ b/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp
@@ -651,7 +651,7 @@ QGeoMap::ItemType QDeclarativePolygonMapItem::itemType() const
*/
void QDeclarativePolygonMapItem::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry)
{
- if (updatingGeometry_ || newGeometry.topLeft() == oldGeometry.topLeft()) {
+ if (!map() || !geopath_.isValid() || updatingGeometry_ || newGeometry.topLeft() == oldGeometry.topLeft()) {
QDeclarativeGeoMapItemBase::geometryChanged(newGeometry, oldGeometry);
return;
}