fixed possible npe when loading null counterpart into message

This commit is contained in:
iNPUTmice 2014-11-14 19:49:44 +01:00
parent 2db569b20f
commit 3118340ade

View file

@ -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;
}