From 36188126d33ef9f39d69a8fa0c5894b66429ff96 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 2 Sep 2023 20:34:49 +0200 Subject: [PATCH] Updated vCard library --- app/build.gradle | 2 +- app/src/main/java/eu/faircode/email/MessageHelper.java | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) 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();