aboutsummaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qml
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-08-10 13:45:15 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-08-10 09:58:19 -0700
commitf3acb0ca0242b8f5345dfb04f537c4323486795d (patch)
tree272b8365d690bc1f193a4da510207e8ca4d5b226 /mobile-widgets/qml
parent0cce3ef2a84fb4aca2726893f5699526ca8fb837 (diff)
downloadsubsurface-f3acb0ca0242b8f5345dfb04f537c4323486795d.tar.gz
Mobile: catch null references in DownloadDCThread
There are reported crashes on Android that suggest a null "tables" attribute in DownloadDCThread. This should never happen, as the table() function connected to this attribute returns the address of a subobject. Thus, even if the original DownloadThread is null, this would not return a null pointer (the subobject is not at address 0). Catch these null-object accesses and write a warning message to the console. Hopefully, this will help is localizing the problem. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'mobile-widgets/qml')
-rw-r--r--mobile-widgets/qml/DownloadFromDiveComputer.qml4
1 files changed, 4 insertions, 0 deletions
diff --git a/mobile-widgets/qml/DownloadFromDiveComputer.qml b/mobile-widgets/qml/DownloadFromDiveComputer.qml
index f6a323300..229b5322d 100644
--- a/mobile-widgets/qml/DownloadFromDiveComputer.qml
+++ b/mobile-widgets/qml/DownloadFromDiveComputer.qml
@@ -28,6 +28,10 @@ Kirigami.Page {
id: downloadThread
onFinished : {
+ if (!table || !sites) {
+ console.warn("DCDownloadThread::onFinished(): table or sites is null!")
+ return
+ }
importModel.repopulate(table, sites)
progressBar.visible = false
if (dcImportModel.rowCount() > 0) {