mirror of
https://github.com/nextcloud/android.git
synced 2024-11-25 22:55:46 +03:00
Fix tests
Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
parent
09baaa6e1b
commit
cd54581320
2 changed files with 10 additions and 2 deletions
|
@ -40,7 +40,11 @@ fun <T : Serializable?> Bundle?.getSerializableArgument(key: String, type: Class
|
|||
this.getSerializable(key, type)
|
||||
} else {
|
||||
@Suppress("UNCHECKED_CAST", "DEPRECATION")
|
||||
this.getSerializable(key) as T
|
||||
if (type.isInstance(this.getSerializable(key))) {
|
||||
this.getSerializable(key) as T
|
||||
} else {
|
||||
null
|
||||
}
|
||||
}
|
||||
} catch (e: ClassCastException) {
|
||||
Log_OC.e(tag, e.localizedMessage)
|
||||
|
|
|
@ -40,7 +40,11 @@ fun <T : Serializable?> Intent?.getSerializableArgument(key: String, type: Class
|
|||
this.getSerializableExtra(key, type)
|
||||
} else {
|
||||
@Suppress("UNCHECKED_CAST", "DEPRECATION")
|
||||
this.getSerializableExtra(key) as T
|
||||
if (type.isInstance(this.getSerializableExtra(key))) {
|
||||
this.getSerializableExtra(key) as T
|
||||
} else {
|
||||
null
|
||||
}
|
||||
}
|
||||
} catch (e: ClassCastException) {
|
||||
Log_OC.e(tag, e.localizedMessage)
|
||||
|
|
Loading…
Reference in a new issue