mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-30 12:32:17 -05:00
prevent nullpointer in ImportKeysServerFragment, return empty lists instead of null
This commit is contained in:
parent
9258fbfb74
commit
428d6b1182
@ -222,7 +222,7 @@ public class ContactHelper {
|
|||||||
Cursor mailCursor = resolver.query(ContactsContract.CommonDataKinds.Email.CONTENT_URI,
|
Cursor mailCursor = resolver.query(ContactsContract.CommonDataKinds.Email.CONTENT_URI,
|
||||||
new String[]{ContactsContract.CommonDataKinds.Email.DATA},
|
new String[]{ContactsContract.CommonDataKinds.Email.DATA},
|
||||||
null, null, null);
|
null, null, null);
|
||||||
if (mailCursor == null) return null;
|
if (mailCursor == null) return new ArrayList<String>();
|
||||||
|
|
||||||
Set<String> mails = new HashSet<String>();
|
Set<String> mails = new HashSet<String>();
|
||||||
while (mailCursor.moveToNext()) {
|
while (mailCursor.moveToNext()) {
|
||||||
@ -240,7 +240,7 @@ public class ContactHelper {
|
|||||||
Cursor cursor = resolver.query(ContactsContract.Contacts.CONTENT_URI,
|
Cursor cursor = resolver.query(ContactsContract.Contacts.CONTENT_URI,
|
||||||
new String[]{ContactsContract.Contacts.DISPLAY_NAME},
|
new String[]{ContactsContract.Contacts.DISPLAY_NAME},
|
||||||
null, null, null);
|
null, null, null);
|
||||||
if (cursor == null) return null;
|
if (cursor == null) return new ArrayList<String>();
|
||||||
|
|
||||||
Set<String> names = new HashSet<String>();
|
Set<String> names = new HashSet<String>();
|
||||||
while (cursor.moveToNext()) {
|
while (cursor.moveToNext()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user