mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Fix #1416
This commit is contained in:
parent
b8bc8e2c47
commit
9b6766d3b2
@ -24,6 +24,7 @@ namespace FireflyIII\Repositories\Attachment;
|
|||||||
|
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Crypt;
|
use Crypt;
|
||||||
|
use Exception;
|
||||||
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
|
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
|
||||||
use FireflyIII\Models\Attachment;
|
use FireflyIII\Models\Attachment;
|
||||||
use FireflyIII\Models\Note;
|
use FireflyIII\Models\Note;
|
||||||
@ -52,7 +53,11 @@ class AttachmentRepository implements AttachmentRepositoryInterface
|
|||||||
$helper = app(AttachmentHelperInterface::class);
|
$helper = app(AttachmentHelperInterface::class);
|
||||||
|
|
||||||
$file = $helper->getAttachmentLocation($attachment);
|
$file = $helper->getAttachmentLocation($attachment);
|
||||||
unlink($file);
|
try {
|
||||||
|
unlink($file);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
Log::error(sprintf('Could not delete file for attachment %d.', $attachment->id));
|
||||||
|
}
|
||||||
$attachment->delete();
|
$attachment->delete();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user