mirror of
https://github.com/element-hq/element-android
synced 2024-11-27 20:06:51 +03:00
Avoid UNCHECKED_CAST.
This commit is contained in:
parent
5cb47dae35
commit
3c1e1090e7
2 changed files with 5 additions and 5 deletions
|
@ -20,7 +20,6 @@ apply plugin: 'kotlin-android-extensions'
|
|||
|
||||
android {
|
||||
compileSdkVersion 29
|
||||
buildToolsVersion "29.0.3"
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 19
|
||||
|
|
|
@ -103,10 +103,11 @@ abstract class Picker<T>(open val requestCode: Int) {
|
|||
selectedUriList.add(dataUri)
|
||||
} else {
|
||||
data?.extras?.get(Intent.EXTRA_STREAM)?.let {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
when (it) {
|
||||
is List<*> -> selectedUriList.addAll(it as List<Uri>)
|
||||
else -> selectedUriList.add(it as Uri)
|
||||
(it as? List<*>)?.filterIsInstance<Uri>()?.let { uriList ->
|
||||
selectedUriList.addAll(uriList)
|
||||
}
|
||||
if (it is Uri) {
|
||||
selectedUriList.add(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue