1
0
mirror of https://github.com/nerzhul/ownCloud-SMS-App.git synced 2025-06-09 00:46:10 +00:00

Fix null cursor on lastmessage and prevent a double cursor close in same func

This commit is contained in:
Loic Blot 2016-08-29 00:16:17 +02:00
parent 783ed1dc00
commit 08b54f8aa0

View File

@ -70,7 +70,7 @@ public class SmsFetcher {
try {
String colName;
for(int idx=0;idx<c.getColumnCount();idx++) {
for(int idx = 0; idx < c.getColumnCount(); idx++) {
colName = c.getColumnName(idx);
// Id column is must be an integer
@ -126,6 +126,9 @@ public class SmsFetcher {
// Fetch Sent SMS Message from Built-in Content Provider
Cursor c = (new SmsDataProvider(_context)).query(mbURI);
if (c == null) {
return null;
}
c.moveToNext();
@ -170,7 +173,6 @@ public class SmsFetcher {
results.put(entry);
} catch (JSONException e) {
Log.e(SmsFetcher.TAG, "JSON Exception when reading SMS Mailbox", e);
c.close();
}
c.close();