diff --git a/src/main/kotlin/app/revanced/patches/duolingo/unlocksuper/UnlockDuolingoSuperPatch.kt b/src/main/kotlin/app/revanced/patches/duolingo/unlocksuper/UnlockDuolingoSuperPatch.kt index 3dcd37cbba..532f3902f6 100644 --- a/src/main/kotlin/app/revanced/patches/duolingo/unlocksuper/UnlockDuolingoSuperPatch.kt +++ b/src/main/kotlin/app/revanced/patches/duolingo/unlocksuper/UnlockDuolingoSuperPatch.kt @@ -54,8 +54,8 @@ object UnlockDuolingoSuperPatch : BytecodePatch( } private fun MutableMethod.indexOfReference(reference: Reference) = getInstructions() - .filterIsInstance() - .filter { it.opcode == Opcode.IPUT_BOOLEAN }.indexOfFirst { it.reference == reference }.let { + .indexOfFirst { it is BuilderInstruction22c && it.opcode == Opcode.IPUT_BOOLEAN && it.reference == reference } + .let { if (it == -1) throw PatchException("Could not find index of instruction with supplied reference.") else it }