diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt index b57e37c70..df6ef77c7 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt @@ -26,9 +26,11 @@ class MediaFetcher(val context: Context) { } val curMedia = ArrayList() - if (curPath.startsWith(OTG_PATH)) { - val newMedia = getMediaOnOTG(curPath, isPickImage, isPickVideo, filterMedia, favoritePaths, getVideoDurations) - curMedia.addAll(newMedia) + if (curPath.startsWith(OTG_PATH, true)) { + if (context.hasOTGConnected()) { + val newMedia = getMediaOnOTG(curPath, isPickImage, isPickVideo, filterMedia, favoritePaths, getVideoDurations) + curMedia.addAll(newMedia) + } } else { val newMedia = getMediaInFolder(curPath, isPickImage, isPickVideo, filterMedia, getProperDateTaken, favoritePaths, getVideoDurations) curMedia.addAll(newMedia)