Minor bugfix (#1331)

This commit is contained in:
Imran Remtulla
2024-01-24 19:28:40 -05:00
parent efe6ec0d43
commit 7cf5cafd75

View File

@@ -243,7 +243,9 @@ Future<File> downloadFile(
tempDownloadedFile.deleteSync(recursive: true);
throw response.reasonPhrase ?? tr('unexpectedError');
}
tempDownloadedFile.renameSync(downloadedFile.path);
if (tempDownloadedFile.existsSync()) {
tempDownloadedFile.renameSync(downloadedFile.path);
}
} else {
client.close();
}