diff options
author | iNPUTmice <daniel@gultsch.de> | 2014-11-14 19:49:44 +0100 |
---|---|---|
committer | iNPUTmice <daniel@gultsch.de> | 2014-11-14 19:49:44 +0100 |
commit | 3118340ade6c7fc818afb266bcf5394a3d3be365 (patch) | |
tree | c14b433078c83f43c83d36aa4b282651fba477a9 /src/main/java | |
parent | 2db569b20f0ec0468c70cc8c944eb181d00f103a (diff) |
fixed possible npe when loading null counterpart into message
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/eu/siacs/conversations/entities/Message.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/eu/siacs/conversations/entities/Message.java b/src/main/java/eu/siacs/conversations/entities/Message.java index 0a9e5da24..5b44435e8 100644 --- a/src/main/java/eu/siacs/conversations/entities/Message.java +++ b/src/main/java/eu/siacs/conversations/entities/Message.java @@ -96,7 +96,12 @@ public class Message extends AbstractEntity { public static Message fromCursor(Cursor cursor) { Jid jid; try { - jid = Jid.fromString(cursor.getString(cursor.getColumnIndex(COUNTERPART))); + String value = cursor.getString(cursor.getColumnIndex(COUNTERPART)); + if (value!=null) { + jid = Jid.fromString(value); + } else { + jid = null; + } } catch (InvalidJidException e) { jid = null; } |