fixed launch crash on API < 24
This commit is contained in:
parent
b4c46ae9b2
commit
685d5c6944
1 changed files with 3 additions and 1 deletions
|
@ -27,7 +27,9 @@ class MediaStoreStreamHandler(private val context: Context, arguments: Any?) : E
|
|||
if (arguments is Map<*, *>) {
|
||||
knownEntries = (arguments["knownEntries"] as? Map<*, *>?)?.map { (it.key as Number?)?.toLong() to it.value as Int? }?.toMap()
|
||||
directory = arguments["directory"] as String?
|
||||
safe = arguments.getOrDefault("safe", false) as Boolean
|
||||
// do not use kotlin.collections `getOrDefault` as it crashes on API <24
|
||||
// and there is no warning from Android Studio
|
||||
safe = arguments["safe"] as Boolean? ?: false
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue