Hi all,
I get the values from a sqlite db table and the following code works fine when said table has at least one record.
But if the table is empty, the app crashes at this point.
I tried things like:
But it doesn't help.
How can I prevent a crash ?
Thanks,
Alban
I get the values from a sqlite db table and the following code works fine when said table has at least one record.
B4X:
listRange = DBUtils.ExecuteMemoryTable(SQL1, "SELECT max(value) as max, min(value) as min, avg(value) as average FROM 'track_values' WHERE tracker_id=? ", Array As String(id),0)
But if the table is empty, the app crashes at this point.
I tried things like:
B4X:
Try
listRange = DBUtils.ExecuteMemoryTable(SQL1, "SELECT max(value) as max, min(value) as min, avg(value) as average FROM 'track_values' WHERE tracker_id=? ", Array As String(id),0)
Catch
Log(LastException.Message)
End Try
If listRange.IsInitialized Then
... do some stuff
End If
But it doesn't help.
How can I prevent a crash ?
Thanks,
Alban