mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-16 22:58:09 +00:00
Fix error when un-decryptable files would break the export.
This commit is contained in:
@@ -94,7 +94,8 @@ class AttachmentCollector extends BasicCollector implements CollectorInterface
|
|||||||
*/
|
*/
|
||||||
private function exportAttachment(Attachment $attachment): bool
|
private function exportAttachment(Attachment $attachment): bool
|
||||||
{
|
{
|
||||||
$file = $attachment->fileName();
|
$file = $attachment->fileName();
|
||||||
|
$decrypted = false;
|
||||||
if ($this->uploadDisk->exists($file)) {
|
if ($this->uploadDisk->exists($file)) {
|
||||||
try {
|
try {
|
||||||
$decrypted = Crypt::decrypt($this->uploadDisk->get($file));
|
$decrypted = Crypt::decrypt($this->uploadDisk->get($file));
|
||||||
@@ -104,6 +105,9 @@ class AttachmentCollector extends BasicCollector implements CollectorInterface
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ($decrypted === false) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
$exportFile = $this->exportFileName($attachment);
|
$exportFile = $this->exportFileName($attachment);
|
||||||
$this->exportDisk->put($exportFile, $decrypted);
|
$this->exportDisk->put($exportFile, $decrypted);
|
||||||
$this->getEntries()->push($exportFile);
|
$this->getEntries()->push($exportFile);
|
||||||
|
|||||||
Reference in New Issue
Block a user