kopia lustrzana https://github.com/ryukoposting/Signal-Android
Avoid possibility of walking outside a contact cursor.
rodzic
b4266b8575
commit
ec07e4b233
|
@ -334,7 +334,7 @@ public class DirectoryHelper {
|
|||
Log.w(TAG, "Ignoring unexpected mime type: " + mimeType);
|
||||
}
|
||||
|
||||
while (getLookupKey(cursor).equals(lookupKey) && isPhoneMimeType(getMimeType(cursor))) {
|
||||
while (!cursor.isAfterLast() && getLookupKey(cursor).equals(lookupKey) && isPhoneMimeType(getMimeType(cursor))) {
|
||||
String number = CursorUtil.requireString(cursor, ContactsContract.CommonDataKinds.Phone.NUMBER);
|
||||
|
||||
if (isValidContactNumber(number)) {
|
||||
|
@ -359,7 +359,7 @@ public class DirectoryHelper {
|
|||
cursor.moveToNext();
|
||||
}
|
||||
|
||||
if (getLookupKey(cursor).equals(lookupKey)) {
|
||||
if (!cursor.isAfterLast() && getLookupKey(cursor).equals(lookupKey)) {
|
||||
if (isStructuredNameMimeType(getMimeType(cursor))) {
|
||||
StructuredNameRecord.Builder builder = new StructuredNameRecord.Builder();
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue