Fix empty name crash when fetching first alpha recipient row.

This commit is contained in:
Clark Chen 2023-03-29 10:53:04 -04:00
parent 0017b7af26
commit cb4a45fea3

View file

@ -233,7 +233,7 @@ class ContactSearchPagedDataSource(
cursor.moveToPosition(-1)
while (cursor.moveToNext()) {
val sortName = cursor.getString(cursor.getColumnIndexOrThrow(ContactRepository.NAME_COLUMN))
if (!sortName.first().isDigit()) {
if (sortName.isNotEmpty() && !sortName.first().isDigit()) {
return cursor.position
}
}