We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent faa9a66 commit 5227b4cCopy full SHA for 5227b4c
app/src/main/java/com/philkes/notallyx/utils/AndroidExtensions.kt
@@ -533,7 +533,13 @@ fun Context.toReadablePath(uri: Uri): String {
533
if (uri.authority == "com.android.externalstorage.documents") {
534
return toReadable(uri.path!!)
535
}
536
- val documentFile = DocumentFile.fromTreeUri(this, uri)
+
537
+ val documentFile =
538
+ try {
539
+ DocumentFile.fromTreeUri(this, uri)
540
+ } catch (_: Exception) {
541
+ null
542
+ }
543
return documentFile?.name?.let { "${uri.authority}/$it" }
544
?: uri.path?.let { toReadable(it) }
545
?: uri.toString()
0 commit comments