parent
d543c0b36e
commit
92422a939a
1 changed files with 2 additions and 2 deletions
|
@ -198,9 +198,9 @@ public class ThreadDatabase extends Database {
|
||||||
try {
|
try {
|
||||||
cursor = DatabaseFactory.getMmsSmsDatabase(context).getConversation(threadId);
|
cursor = DatabaseFactory.getMmsSmsDatabase(context).getConversation(threadId);
|
||||||
|
|
||||||
if (cursor != null && cursor.getCount() > length) {
|
if (cursor != null && length > 0 && cursor.getCount() > length) {
|
||||||
Log.w("ThreadDatabase", "Cursor count is greater than length!");
|
Log.w("ThreadDatabase", "Cursor count is greater than length!");
|
||||||
cursor.moveToPosition(cursor.getCount() - length);
|
cursor.moveToPosition(length - 1);
|
||||||
|
|
||||||
long lastTweetDate = cursor.getLong(cursor.getColumnIndexOrThrow(MmsSmsColumns.NORMALIZED_DATE_RECEIVED));
|
long lastTweetDate = cursor.getLong(cursor.getColumnIndexOrThrow(MmsSmsColumns.NORMALIZED_DATE_RECEIVED));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue