From 3118340ade6c7fc818afb266bcf5394a3d3be365 Mon Sep 17 00:00:00 2001 From: iNPUTmice Date: Fri, 14 Nov 2014 19:49:44 +0100 Subject: fixed possible npe when loading null counterpart into message --- src/main/java/eu/siacs/conversations/entities/Message.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/main/java/eu/siacs/conversations/entities/Message.java b/src/main/java/eu/siacs/conversations/entities/Message.java index 0a9e5da2..5b44435e 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; } -- cgit v1.2.3