forked from GitHub-Mirror/riotX-android
Fix crash (IllegalStateException) observed on PlayStore
This commit is contained in:
parent
12a0cbb400
commit
3584658c36
@ -35,9 +35,9 @@ fun getFilenameFromUri(context: Context?, uri: Uri): String? {
|
||||
}
|
||||
if (result == null) {
|
||||
result = uri.path
|
||||
val cut = result.lastIndexOf('/')
|
||||
val cut = result?.lastIndexOf('/') ?: -1
|
||||
if (cut != -1) {
|
||||
result = result.substring(cut + 1)
|
||||
result = result?.substring(cut + 1)
|
||||
}
|
||||
}
|
||||
return result
|
||||
|
Loading…
Reference in New Issue
Block a user