Skip to content

Commit

Permalink
fix: Only set Android key if not null to prevent build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX committed Jan 27, 2024
1 parent e362071 commit 1181b0b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ abstract class BasePreference(
*/
open fun serialize(ownerDocument: Document, resourceCallback: (BaseResource) -> Unit): Element =
ownerDocument.createElement(tag).apply {
setAttribute("android:key", key)
key?.let { setAttribute("android:key", it) }
setAttribute("android:title", "@string/${titleKey}")
summaryKey?.let { addSummary(it) }
}
Expand Down

0 comments on commit 1181b0b

Please sign in to comment.