From f3acb0ca0242b8f5345dfb04f537c4323486795d Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sat, 10 Aug 2019 13:45:15 +0200 Subject: 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 --- mobile-widgets/qml/DownloadFromDiveComputer.qml | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'mobile-widgets') 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) { -- cgit v1.2.3-70-g09d2