handle cases when uri.lastPathSegment returns null
This commit is contained in:
parent
6091a6f1da
commit
5bce4f5577
1 changed files with 1 additions and 1 deletions
|
@ -192,7 +192,7 @@ fun Context.getFilenameFromUri(uri: Uri): String {
|
|||
} else {
|
||||
var name = getFilenameFromContentUri(uri) ?: ""
|
||||
if (name.isEmpty()) {
|
||||
name = uri.lastPathSegment
|
||||
name = uri.lastPathSegment ?: ""
|
||||
}
|
||||
name
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue