Skip to content

Commit

Permalink
fix: crash when searching sensitive words (#1551)
Browse files Browse the repository at this point in the history
在搜索一些敏感词时(比如“药娘”),会因为无法为navList插入元素导致崩溃
  • Loading branch information
CodePwn2021 authored Nov 12, 2024
1 parent 7d07474 commit 845ceff
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,10 @@ class BangumiSeasonHook(classLoader: ClassLoader) : BaseHook(classLoader) {
val navList = v.callMethodAs<List<Any>>("getNavList")
.map { SearchNav.parseFrom(it.callMethodAs<ByteArray>("toByteArray")) }
.toMutableList()
// fix crash when searching sensitive words
if (navList.size == 0) {
return
}
val currentArea = runCatchingOrNull {
XposedInit.country.get(5L, TimeUnit.SECONDS)
}
Expand Down

0 comments on commit 845ceff

Please sign in to comment.