diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Context.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Context.kt index b6cfeed06..77570c4ac 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Context.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Context.kt @@ -304,7 +304,7 @@ fun Context.getMimeTypeFromUri(uri: Uri): String { fun Context.ensurePublicUri(path: String, applicationId: String): Uri? { val uri = Uri.parse(path) return when { - isPathOnOTG(path) -> getDocumentFile(path)?.uri + isPathOnOTG(path) && baseConfig.OTGPartition.isNotEmpty() && baseConfig.OTGTreeUri.isNotEmpty() -> getDocumentFile(path)?.uri uri.scheme == "content" -> uri else -> { val newPath = if (uri.toString().startsWith("/")) uri.toString() else uri.path