Browse Source

Fix NullPointerException

merge-requests/382/head
Nicolas Pomepuy 7 years ago
committed by Geoffrey Métais
parent
commit
9cdff021ae
  1. 2
      vlc-android/src/org/videolan/vlc/util/Kextensions.kt

2
vlc-android/src/org/videolan/vlc/util/Kextensions.kt

@ -134,7 +134,7 @@ fun List<AbstractMediaWrapper>.updateWithMLMeta() : MutableList<AbstractMediaWra
@ExperimentalCoroutinesApi
@ObsoleteCoroutinesApi
suspend fun String.scanAllowed() = withContext(Dispatchers.IO) {
val file = File(Uri.parse(this@scanAllowed).path)
val file = File(Uri.parse(this@scanAllowed).path ?: return@withContext false)
if (!file.exists() || !file.canRead()) return@withContext false
if (AndroidDevices.watchDevices && file.list()?.any { it == ".nomedia" } == true) return@withContext false
true

Loading…
Cancel
Save