mirror of
https://github.com/ankidroid/Anki-Android.git
synced 2024-09-19 19:42:17 +02:00
chore: guard against null getExternalFilesDirs
I know `getExternalFilesDir(null)!!` can throw, I'm unsure if the array can throw, but it's best to be safe here
This commit is contained in:
parent
9175d9ec29
commit
0d46ac3523
@ -230,7 +230,7 @@ object CollectionHelper {
|
||||
* @see android.content.Context.getExternalFilesDirs
|
||||
*/
|
||||
fun getAppSpecificExternalDirectories(context: Context): List<File> {
|
||||
return context.getExternalFilesDirs(null).filterNotNull()
|
||||
return context.getExternalFilesDirs(null)?.filterNotNull() ?: listOf()
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user