Skip to content

Commit 6ecf53f

Browse files
committed
fix: Only set Android key if not null to prevent build errors
1 parent 8c2f895 commit 6ecf53f

File tree

1 file changed

+1
-1
lines changed
  • src/main/kotlin/app/revanced/patches/shared/misc/settings/preference

1 file changed

+1
-1
lines changed

src/main/kotlin/app/revanced/patches/shared/misc/settings/preference/BasePreference.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ abstract class BasePreference(
3030
*/
3131
open fun serialize(ownerDocument: Document, resourceCallback: (BaseResource) -> Unit): Element =
3232
ownerDocument.createElement(tag).apply {
33-
setAttribute("android:key", key)
33+
key?.let { setAttribute("android:key", it) }
3434
setAttribute("android:title", "@string/${titleKey}")
3535
summaryKey?.let { addSummary(it) }
3636
}

0 commit comments

Comments
 (0)