mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
Fix class cast exception #986
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
KeePassDX(3.0.0)
|
||||
*
|
||||
KeePassDX(2.10.1)
|
||||
* Fix parcelable with custom data #986
|
||||
|
||||
KeePassDX(2.10.0)
|
||||
* Manage new database format 4.1 #956
|
||||
|
||||
@@ -12,7 +12,7 @@ android {
|
||||
minSdkVersion 15
|
||||
targetSdkVersion 30
|
||||
versionCode = 77
|
||||
versionName = "3.0.0"
|
||||
versionName = "2.10.1"
|
||||
multiDexEnabled true
|
||||
|
||||
testApplicationId = "com.kunzisoft.keepass.tests"
|
||||
|
||||
@@ -42,8 +42,12 @@ object ParcelableUtil {
|
||||
val size = parcel.readInt()
|
||||
val map = HashMap<K, V>(size)
|
||||
for (i in 0 until size) {
|
||||
val key: K? = kClass.cast(parcel.readParcelable(kClass.classLoader))
|
||||
val value: V? = vClass.cast(parcel.readParcelable(vClass.classLoader))
|
||||
val key: K? = try {
|
||||
parcel.readParcelable(kClass.classLoader)
|
||||
} catch (e: Exception) { null }
|
||||
val value: V? = try {
|
||||
parcel.readParcelable(vClass.classLoader)
|
||||
} catch (e: Exception) { null }
|
||||
if (key != null && value != null)
|
||||
map[key] = value
|
||||
}
|
||||
@@ -76,7 +80,9 @@ object ParcelableUtil {
|
||||
val map = LinkedHashMap<String, V>(size)
|
||||
for (i in 0 until size) {
|
||||
val key: String? = parcel.readString()
|
||||
val value: V? = parcel.readParcelable(vClass.classLoader)
|
||||
val value: V? = try {
|
||||
parcel.readParcelable(vClass.classLoader)
|
||||
} catch (e: Exception) { null }
|
||||
if (key != null && value != null)
|
||||
map[key] = value
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user