From 9e7ee7215df3ae86b9725f4e6f1564a74f1ef526 Mon Sep 17 00:00:00 2001 From: cketti Date: Fri, 21 Apr 2023 17:58:50 +0200 Subject: [PATCH] Don't fail when exporting an identity without a sender name --- .../main/java/com/fsck/k9/preferences/SettingsExporter.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/core/src/main/java/com/fsck/k9/preferences/SettingsExporter.kt b/app/core/src/main/java/com/fsck/k9/preferences/SettingsExporter.kt index 2ea09cb8d0b..bf92efd7e75 100644 --- a/app/core/src/main/java/com/fsck/k9/preferences/SettingsExporter.kt +++ b/app/core/src/main/java/com/fsck/k9/preferences/SettingsExporter.kt @@ -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?