Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

mobile: catch error when moving file fails after download

Ammar Ahmeded2201d525e6
diff --git a/apps/mobile/app/common/filesystem/download.ts b/apps/mobile/app/common/filesystem/download.ts
index 3c9e8e295..b9fad08a6 100644
--- a/apps/mobile/app/common/filesystem/download.ts
+++ b/apps/mobile/app/common/filesystem/download.ts
@@ -149,7 +149,9 @@ export async function downloadFile(
});
}
- await RNFetchBlob.fs.mv(tempFilePath, originalFilePath);
+ await RNFetchBlob.fs.mv(tempFilePath, originalFilePath).catch(() => {
+ /* empty */
+ });
if (!(await exists(filename))) {
throw new Error("File size mismatch");