summaryrefslogtreecommitdiffstats
path: root/map-widget/qml/MapWidget.qml
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-08-25 12:21:37 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-08-28 07:12:01 -0700
commitb3fd824d189056b845452d57fb967a2b50550921 (patch)
tree5af4d2bb079936bdf2202a282d7c6bfb3789c203 /map-widget/qml/MapWidget.qml
parent25b30da2446d9daf8343c246056b207d285582e7 (diff)
downloadsubsurface-b3fd824d189056b845452d57fb967a2b50550921.tar.gz
Map: catch null divesites in map widget selection code
Just to be sure, refuse to add null divesites to the selection. Moreover, refuse to call the setSelected function on a null-divesite. I got an unfriendly Qt-Warning there: "Passing incompatible arguments to C++ functions from JavaScript is dangerous and deprecated." "This will throw a JavaScript TypeError in future releases of Qt!" Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'map-widget/qml/MapWidget.qml')
-rw-r--r--map-widget/qml/MapWidget.qml2
1 files changed, 1 insertions, 1 deletions
diff --git a/map-widget/qml/MapWidget.qml b/map-widget/qml/MapWidget.qml
index 88e9d95a6..602b7c338 100644
--- a/map-widget/qml/MapWidget.qml
+++ b/map-widget/qml/MapWidget.qml
@@ -69,7 +69,7 @@ Item {
drag.target: (mapHelper.editMode && mapHelper.model.isSelected(model.divesite)) ? mapItem : undefined
anchors.fill: parent
onClicked: {
- if (!mapHelper.editMode)
+ if (!mapHelper.editMode && model.divesite)
mapHelper.model.setSelected(model.divesite, true)
}
onDoubleClicked: map.doubleClickHandler(mapItem.coordinate)