fix: Only set Android key if not null to prevent build errors
This commit is contained in:
parent
e362071505
commit
1181b0bca2
|
@ -30,7 +30,7 @@ abstract class BasePreference(
|
||||||
*/
|
*/
|
||||||
open fun serialize(ownerDocument: Document, resourceCallback: (BaseResource) -> Unit): Element =
|
open fun serialize(ownerDocument: Document, resourceCallback: (BaseResource) -> Unit): Element =
|
||||||
ownerDocument.createElement(tag).apply {
|
ownerDocument.createElement(tag).apply {
|
||||||
setAttribute("android:key", key)
|
key?.let { setAttribute("android:key", it) }
|
||||||
setAttribute("android:title", "@string/${titleKey}")
|
setAttribute("android:title", "@string/${titleKey}")
|
||||||
summaryKey?.let { addSummary(it) }
|
summaryKey?.let { addSummary(it) }
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue