Skip to content

Commit

Permalink
Undo unreasonable fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Mygod committed Oct 22, 2024
1 parent b38500d commit 7b8db1b
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib/src/main/java/be/mygod/librootkotlinx/Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package be.mygod.librootkotlinx
import android.annotation.SuppressLint
import android.content.Context
import android.content.res.Resources
import android.os.BadParcelableException
import android.os.Parcel
import android.os.Parcelable
import android.system.ErrnoException
Expand Down Expand Up @@ -290,11 +289,7 @@ fun Parcelable?.toByteArray(parcelableFlags: Int = 0) = useParcel { p ->
inline fun <reified T : Parcelable> ByteArray.toParcelable(classLoader: ClassLoader?) = useParcel { p ->
p.unmarshall(this, 0, size)
p.setDataPosition(0)
try {
ParcelCompat.readParcelable(p, classLoader, T::class.java)
} catch (_: BadParcelableException) {
ParcelCompat.readParcelable(p, null, T::class.java)
}
ParcelCompat.readParcelable(p, classLoader, T::class.java)
}

// Stream closed caused in NullOutputStream
Expand Down

0 comments on commit 7b8db1b

Please sign in to comment.