diff --git a/app/build.gradle b/app/build.gradle index 1fa0410597..6741172759 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -489,7 +489,7 @@ dependencies { def badge_version = "1.1.22" def bugsnag_version = "5.28.2" def biweekly_version = "0.6.6" - def vcard_version = "0.11.3" + def vcard_version = "0.12.1" def relinker_version = "1.4.5" def markwon_version = "4.6.2" def bouncycastle_version = "1.76" diff --git a/app/src/main/java/eu/faircode/email/MessageHelper.java b/app/src/main/java/eu/faircode/email/MessageHelper.java index ba472f9bf8..4e265c0465 100644 --- a/app/src/main/java/eu/faircode/email/MessageHelper.java +++ b/app/src/main/java/eu/faircode/email/MessageHelper.java @@ -1267,8 +1267,10 @@ public class MessageHelper { attachment.id = db.attachment().insertAttachment(attachment); File file = attachment.getFile(context); - try (VCardWriter writer = new VCardWriter(file, VCardVersion.V3_0)) { - writer.write(vcard); + try (OutputStream os = new FileOutputStream(file)) { + try (VCardWriter writer = new VCardWriter(os, VCardVersion.V3_0)) { + writer.write(vcard); + } } attachment.size = file.length();