mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-30 20:52:21 -05:00
avoid very rare npe
This commit is contained in:
parent
1c86098f3b
commit
d30fb6f0a1
@ -74,6 +74,9 @@ public class Roster {
|
||||
}
|
||||
|
||||
public void initContact(final Contact contact) {
|
||||
if (contact == null) {
|
||||
return;
|
||||
}
|
||||
contact.setAccount(account);
|
||||
contact.setOption(Contact.Options.IN_ROSTER);
|
||||
synchronized (this.contacts) {
|
||||
|
@ -386,8 +386,7 @@ public class DatabaseBackend extends SQLiteOpenHelper {
|
||||
SQLiteDatabase db = this.getReadableDatabase();
|
||||
Cursor cursor;
|
||||
String args[] = { roster.getAccount().getUuid() };
|
||||
cursor = db.query(Contact.TABLENAME, null, Contact.ACCOUNT + "=?",
|
||||
args, null, null, null);
|
||||
cursor = db.query(Contact.TABLENAME, null, Contact.ACCOUNT + "=?", args, null, null, null);
|
||||
while (cursor.moveToNext()) {
|
||||
roster.initContact(Contact.fromCursor(cursor));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user