Skip to content

Commit

Permalink
Fix crash on Discord status settings open
Browse files Browse the repository at this point in the history
  • Loading branch information
toasterofbread committed Nov 28, 2023
1 parent 03a02e8 commit 2e1fa72
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions androidApp/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
# Kuromoji
-keep class com.atilika.kuromoji.** { *; }

# JAudioTagger
-dontwarn org.jaudiotagger.**
-keep class org.jaudiotagger.** { *; }

# From proguard-android-optimize.txt

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,17 @@ sealed class SettingsCategory(id: String) {

override fun getItems(context: AppContext): List<SettingsItem>? {
if (items == null) {
items = getPageItems(context).filter { it.getKeys().none { category.getKeyOfName(it)!!.isHidden() } }
items = getPageItems(context).filter {
it.getKeys().none { key_name ->
for (cat in listOf(category) + SettingsCategory.all) {
val key: SettingsKey? = cat.getKeyOfName(key_name)
if (key != null) {
return@none key.isHidden()
}
}
throw RuntimeException("Key not found: $key_name (category: $category)")
}
}
}
return items!!
}
Expand Down

0 comments on commit 2e1fa72

Please sign in to comment.