Skip to content

Firefly III: a personal finances manager

Fix error when un-decryptable files would break the export.

James Cole8acb9f405650
diff --git a/app/Export/Collector/AttachmentCollector.php b/app/Export/Collector/AttachmentCollector.php
index 5405855e3b..244cc919ed 100644
--- a/app/Export/Collector/AttachmentCollector.php
+++ b/app/Export/Collector/AttachmentCollector.php
@@ -94,7 +94,8 @@ class AttachmentCollector extends BasicCollector implements CollectorInterface
*/
private function exportAttachment(Attachment $attachment): bool
{
- $file = $attachment->fileName();
+ $file = $attachment->fileName();
+ $decrypted = false;
if ($this->uploadDisk->exists($file)) {
try {
$decrypted = Crypt::decrypt($this->uploadDisk->get($file));
@@ -104,6 +105,9 @@ class AttachmentCollector extends BasicCollector implements CollectorInterface
return false;
}
}
+ if ($decrypted === false) {
+ return false;
+ }
$exportFile = $this->exportFileName($attachment);
$this->exportDisk->put($exportFile, $decrypted);
$this->getEntries()->push($exportFile);