fixed possible npe when loading null counterpart into message
This commit is contained in:
parent
2db569b20f
commit
3118340ade
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue