mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-28 03:32:15 -05:00
catch exception when reading message id from database
This commit is contained in:
parent
c5743067ad
commit
943d0391d4
@ -606,6 +606,7 @@ public class DatabaseBackend extends SQLiteOpenHelper {
|
||||
}
|
||||
|
||||
public Pair<Long, String> getLastMessageReceived(Account account) {
|
||||
try {
|
||||
SQLiteDatabase db = this.getReadableDatabase();
|
||||
String sql = "select messages.timeSent,messages.serverMsgId from accounts join conversations on accounts.uuid=conversations.accountUuid join messages on conversations.uuid=messages.conversationUuid where accounts.uuid=? and (messages.status=0 or messages.carbon=1 or messages.serverMsgId not null) order by messages.timesent desc limit 1";
|
||||
String[] args = {account.getUuid()};
|
||||
@ -616,6 +617,9 @@ public class DatabaseBackend extends SQLiteOpenHelper {
|
||||
cursor.moveToFirst();
|
||||
return new Pair<>(cursor.getLong(0), cursor.getString(1));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public Conversation findConversationByUuid(String conversationUuid) {
|
||||
|
Loading…
Reference in New Issue
Block a user