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) {
|
public static Message fromCursor(Cursor cursor) {
|
||||||
Jid jid;
|
Jid jid;
|
||||||
try {
|
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) {
|
} catch (InvalidJidException e) {
|
||||||
jid = null;
|
jid = null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue