aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/main/java/de/pixart/messenger/entities/Message.java2
-rw-r--r--src/main/java/de/pixart/messenger/persistance/DatabaseBackend.java6
-rw-r--r--src/main/java/de/pixart/messenger/services/ExportLogsService.java2
3 files changed, 8 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/entities/Message.java b/src/main/java/de/pixart/messenger/entities/Message.java
index 8ac7735d6..5a3549a95 100644
--- a/src/main/java/de/pixart/messenger/entities/Message.java
+++ b/src/main/java/de/pixart/messenger/entities/Message.java
@@ -154,6 +154,8 @@ public class Message extends AbstractEntity {
}
} catch (InvalidJidException e) {
jid = null;
+ } catch (IllegalStateException e) {
+ return null; // message too long?
}
Jid trueCounterpart;
try {
diff --git a/src/main/java/de/pixart/messenger/persistance/DatabaseBackend.java b/src/main/java/de/pixart/messenger/persistance/DatabaseBackend.java
index b40452f1a..50519a2a7 100644
--- a/src/main/java/de/pixart/messenger/persistance/DatabaseBackend.java
+++ b/src/main/java/de/pixart/messenger/persistance/DatabaseBackend.java
@@ -597,8 +597,10 @@ public class DatabaseBackend extends SQLiteOpenHelper {
cursor.moveToLast();
do {
Message message = Message.fromCursor(cursor);
- message.setConversation(conversation);
- list.add(message);
+ if (message != null) {
+ message.setConversation(conversation);
+ list.add(message);
+ }
} while (cursor.moveToPrevious());
}
cursor.close();
diff --git a/src/main/java/de/pixart/messenger/services/ExportLogsService.java b/src/main/java/de/pixart/messenger/services/ExportLogsService.java
index d7948d651..61d8a921d 100644
--- a/src/main/java/de/pixart/messenger/services/ExportLogsService.java
+++ b/src/main/java/de/pixart/messenger/services/ExportLogsService.java
@@ -119,6 +119,8 @@ public class ExportLogsService extends Service {
BufferedWriter bw = null;
try {
for (Message message : mDatabaseBackend.getMessagesIterable(conversation)) {
+ if (message == null)
+ continue;
if (message.getType() == Message.TYPE_TEXT || message.hasFileOnRemoteHost()) {
String date = simpleDateFormat.format(new Date(message.getTimeSent()));
if (bw == null) {