aboutsummaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qml/DiveDetailsEdit.qml
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2017-03-18 14:20:40 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-03-18 17:05:45 -0700
commit9389fd004966d27db3a340940402067fa6aa6559 (patch)
tree1aa52874bb45a27ad83d9e74dde3023bbc823ef3 /mobile-widgets/qml/DiveDetailsEdit.qml
parent33df10cbaa5bd7eb84e54232351cd73739d0a248 (diff)
downloadsubsurface-9389fd004966d27db3a340940402067fa6aa6559.tar.gz
QML UI: don't access members of undefined objects
If we don't have a currentItem, don't try to access its members. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets/qml/DiveDetailsEdit.qml')
-rw-r--r--mobile-widgets/qml/DiveDetailsEdit.qml8
1 files changed, 4 insertions, 4 deletions
diff --git a/mobile-widgets/qml/DiveDetailsEdit.qml b/mobile-widgets/qml/DiveDetailsEdit.qml
index b4584185d..8a0e62c67 100644
--- a/mobile-widgets/qml/DiveDetailsEdit.qml
+++ b/mobile-widgets/qml/DiveDetailsEdit.qml
@@ -163,7 +163,7 @@ Item {
ComboBox {
id: suitBox
editable: true
- model: diveDetailsListView.currentItem.modelData.dive.suitList
+ model: diveDetailsListView.currentItem ? diveDetailsListView.currentItem.modelData.dive.suitList : null
inputMethodHints: Qt.ImhNoPredictiveText
Layout.fillWidth: true
style: ComboBoxStyle {
@@ -178,7 +178,7 @@ Item {
ComboBox {
id: buddyBox
editable: true
- model: diveDetailsListView.currentItem.modelData.dive.buddyList
+ model: diveDetailsListView.currentItem ? diveDetailsListView.currentItem.modelData.dive.buddyList : null
inputMethodHints: Qt.ImhNoPredictiveText
Layout.fillWidth: true
style: ComboBoxStyle {
@@ -193,7 +193,7 @@ Item {
ComboBox {
id: divemasterBox
editable: true
- model: diveDetailsListView.currentItem.modelData.dive.divemasterList
+ model: diveDetailsListView.currentItem ? diveDetailsListView.currentItem.modelData.dive.divemasterList : null
inputMethodHints: Qt.ImhNoPredictiveText
Layout.fillWidth: true
style: ComboBoxStyle {
@@ -218,7 +218,7 @@ Item {
ComboBox {
id: cylinderBox
editable: true
- model: diveDetailsListView.currentItem.modelData.dive.cylinderList
+ model: diveDetailsListView.currentItem ? diveDetailsListView.currentItem.modelData.dive.cylinderList : null
inputMethodHints: Qt.ImhNoPredictiveText
Layout.fillWidth: true
style: ComboBoxStyle {