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>
This commit is contained in:
Berthold Stoeger 2019-08-10 13:45:15 +02:00 committed by Dirk Hohndel
parent 0cce3ef2a8
commit f3acb0ca02

View file

@ -28,6 +28,10 @@ Kirigami.Page {
id: downloadThread id: downloadThread
onFinished : { onFinished : {
if (!table || !sites) {
console.warn("DCDownloadThread::onFinished(): table or sites is null!")
return
}
importModel.repopulate(table, sites) importModel.repopulate(table, sites)
progressBar.visible = false progressBar.visible = false
if (dcImportModel.rowCount() > 0) { if (dcImportModel.rowCount() > 0) {