mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-12-22 07:44:00 +01:00
Avoid UNCHECKED_CAST.
This commit is contained in:
parent
5cb47dae35
commit
3c1e1090e7
@ -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 New Issue
Block a user