Merge pull request #7234 from thundernest/fix_export_settings_backport

Don't fail when exporting an identity without a sender name
This commit is contained in:
cketti 2023-10-11 17:06:54 +02:00 committed by GitHub
commit 315cabd7e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -329,9 +329,11 @@ class SettingsExporter(
// Write name belonging to the identity
val name = prefs[prefix + IDENTITY_NAME_KEY + suffix] as String?
serializer.startTag(null, NAME_ELEMENT)
serializer.text(name)
serializer.endTag(null, NAME_ELEMENT)
if (name != null) {
serializer.startTag(null, NAME_ELEMENT)
serializer.text(name)
serializer.endTag(null, NAME_ELEMENT)
}
// Write email address belonging to the identity
val email = prefs[prefix + IDENTITY_EMAIL_KEY + suffix] as String?