aboutsummaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qml
diff options
context:
space:
mode:
authorGravatar Rick Walsh <rickmwalsh@gmail.com>2017-08-05 17:08:21 +1000
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-08-07 00:51:51 -0700
commit7e4ba965d19edf9d3265592af66747cfc27968dd (patch)
treefa0892dde03b3d4a2a0798cae4e13e460b125810 /mobile-widgets/qml
parent00e401b61fc3b81418e504c76843e5513e90267f (diff)
downloadsubsurface-7e4ba965d19edf9d3265592af66747cfc27968dd.tar.gz
DiveDetailsEdit: make sure model data exists
This gets rid of TypeError messages, but does not appear to affect behaviour qrc:///qml/DiveDetailsEdit.qml:254: TypeError: Cannot read property 'dive' of null qrc:///qml/DiveDetailsEdit.qml:228: TypeError: Cannot read property 'dive' of null qrc:///qml/DiveDetailsEdit.qml:216: TypeError: Cannot read property 'dive' of null qrc:///qml/DiveDetailsEdit.qml:204: TypeError: Cannot read property 'dive' of null Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Diffstat (limited to 'mobile-widgets/qml')
-rw-r--r--mobile-widgets/qml/DiveDetailsEdit.qml12
1 files changed, 8 insertions, 4 deletions
diff --git a/mobile-widgets/qml/DiveDetailsEdit.qml b/mobile-widgets/qml/DiveDetailsEdit.qml
index 3d1b31194..79bd5724e 100644
--- a/mobile-widgets/qml/DiveDetailsEdit.qml
+++ b/mobile-widgets/qml/DiveDetailsEdit.qml
@@ -201,7 +201,8 @@ Item {
}
HintsTextEdit {
id: suitBox
- model: diveDetailsListView.currentItem ? diveDetailsListView.currentItem.modelData.dive.suitList : null
+ model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
+ diveDetailsListView.currentItem.modelData.dive.suitList : null
inputMethodHints: Qt.ImhNoPredictiveText
Layout.fillWidth: true
}
@@ -213,7 +214,8 @@ Item {
}
HintsTextEdit {
id: buddyBox
- model: diveDetailsListView.currentItem ? diveDetailsListView.currentItem.modelData.dive.buddyList : null
+ model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
+ diveDetailsListView.currentItem.modelData.dive.buddyList : null
inputMethodHints: Qt.ImhNoPredictiveText
Layout.fillWidth: true
}
@@ -225,7 +227,8 @@ Item {
}
HintsTextEdit {
id: divemasterBox
- model: diveDetailsListView.currentItem ? diveDetailsListView.currentItem.modelData.dive.divemasterList : null
+ model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
+ diveDetailsListView.currentItem.modelData.dive.divemasterList : null
inputMethodHints: Qt.ImhNoPredictiveText
Layout.fillWidth: true
}
@@ -251,7 +254,8 @@ Item {
}
HintsTextEdit {
id: cylinderBox
- model: diveDetailsListView.currentItem ? diveDetailsListView.currentItem.modelData.dive.cylinderList : null
+ model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
+ diveDetailsListView.currentItem.modelData.dive.cylinderList : null
inputMethodHints: Qt.ImhNoPredictiveText
Layout.fillWidth: true
}