mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-17 19:38:52 +01:00
fix(contacts): Fix a potential memory leak in contact lookup
This commit is contained in:
@@ -177,7 +177,15 @@ class ContactRepositoryImpl @Inject constructor(
|
||||
} else {
|
||||
uri = Uri.withAppendedPath(ContactsContract.PhoneLookup.CONTENT_FILTER_URI, Uri.encode(address))
|
||||
}
|
||||
return context.contentResolver.query(uri, arrayOf(BaseColumns._ID), null, null, null)?.count!! > 0
|
||||
return context.contentResolver.query(
|
||||
uri,
|
||||
arrayOf(BaseColumns._ID),
|
||||
null,
|
||||
null,
|
||||
null
|
||||
)?.use { cursor ->
|
||||
cursor.count > 0
|
||||
} ?: false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user