Skip to content

Commit

Permalink
fix: only emit closed patches that did not throw an exception with th…
Browse files Browse the repository at this point in the history
…e `@Patch` annotation
  • Loading branch information
oSumAtrIX committed Aug 22, 2023
1 parent 5c0c0d6 commit 5938f6b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/main/kotlin/app/revanced/patcher/Patcher.kt
Expand Up @@ -2,6 +2,7 @@ package app.revanced.patcher

import app.revanced.patcher.data.Context
import app.revanced.patcher.data.ResourceContext
import app.revanced.patcher.extensions.AnnotationExtensions.findAnnotationRecursively
import app.revanced.patcher.extensions.PatchExtensions.dependencies
import app.revanced.patcher.extensions.PatchExtensions.patchName
import app.revanced.patcher.extensions.PatchExtensions.requiresIntegrations
Expand Down Expand Up @@ -202,7 +203,15 @@ class Patcher(
)

if (returnOnError) return@flow
} ?: emit(result)
} ?: run {
executedPatch
.patchInstance::class
.java
.findAnnotationRecursively(app.revanced.patcher.patch.annotations.Patch::class)
?: return@run

emit(result)
}
}
}

Expand Down

0 comments on commit 5938f6b

Please sign in to comment.