Skip to content

Commit

Permalink
fix: ignore ignore.txt error
Browse files Browse the repository at this point in the history
  • Loading branch information
MicroCBer committed Feb 3, 2024
1 parent 7f9ed34 commit e26d743
Showing 1 changed file with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -284,16 +284,21 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
return
}

val ignoreIds = File("$exposedPath/ignore.txt").run {
if (exists()) readLines().filterNot { it.startsWith("#") }
else {
writeText(
"""# write the ignored sticker IDs here
|# separate with line breaks
""".trimMargin()
)
emptyList()
val ignoreIds = try {
File("$exposedPath/ignore.txt").run {
if (exists()) readLines().filterNot { it.startsWith("#") }
else {
writeText(
"""# write the ignored sticker IDs here
|# separate with line breaks
""".trimMargin()
)
emptyList()
}
}
} catch (e: Exception) {
YLog.error("Error while reading ignore.txt", e)
emptyList()
}
YLog.info("ignoreIds: [${ignoreIds.joinToString { "`$it`" }}]")

Expand Down

0 comments on commit e26d743

Please sign in to comment.