mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-08-03 18:56:44 -04:00
#1527 SecurityException FIleUtils
This commit is contained in:
parent
894949486d
commit
e22854f6f2
@ -186,12 +186,16 @@ object FileUtils {
|
||||
uri: Uri
|
||||
): String? {
|
||||
val columnName = "_data"
|
||||
return context.contentResolver.query(uri, arrayOf(columnName), null, null, null)
|
||||
return try {
|
||||
context.contentResolver.query(uri, arrayOf(columnName), null, null, null)
|
||||
?.use {
|
||||
if (it.moveToFirst() && it.getColumnIndex(columnName) != -1) {
|
||||
it[columnName]
|
||||
} else null
|
||||
}
|
||||
} catch (ignore: SecurityException) {
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic fun readLocalesFromAssets(context: Context) =
|
||||
|
Loading…
x
Reference in New Issue
Block a user