handle cases when uri.lastPathSegment returns null

This commit is contained in:
tibbi 2017-11-02 10:57:40 +01:00
parent 6091a6f1da
commit 5bce4f5577

View file

@ -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
}