From 6861e6812438a45c8617ad158c3a6e828f67287b Mon Sep 17 00:00:00 2001 From: lukstbit <52494258+lukstbit@users.noreply.github.com> Date: Mon, 7 Aug 2023 15:16:12 +0300 Subject: [PATCH] Fix crash when exporting a deck with a name containing a path separator (#14195) * Fix crash when exporting a deck with a name containing a path separator * Update AnkiDroid/src/main/java/com/ichi2/anki/export/ActivityExportingDelegate.kt --------- Co-authored-by: Brayan Oliveira <69634269+BrayanDSO@users.noreply.github.com> --- .../java/com/ichi2/anki/export/ActivityExportingDelegate.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/export/ActivityExportingDelegate.kt b/AnkiDroid/src/main/java/com/ichi2/anki/export/ActivityExportingDelegate.kt index 1bc2fbaf7ea8..5d617228c0d4 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/export/ActivityExportingDelegate.kt +++ b/AnkiDroid/src/main/java/com/ichi2/anki/export/ActivityExportingDelegate.kt @@ -121,7 +121,8 @@ class ActivityExportingDelegate(private val activity: AnkiActivity, private val } override fun exportDeckAsApkg(path: String?, did: DeckId, includeSched: Boolean, includeMedia: Boolean) { - val deckName = collectionSupplier.get().decks.name(did) + // files can't have `/` in their names + val deckName = collectionSupplier.get().decks.name(did).replace("/", "_") val exportPath = getExportFileName(path, deckName, includeSched) if (BackendFactory.defaultLegacySchema) {