Merge pull request #7640 from firefly-iii/fix-7613

Fix #7613
This commit is contained in:
James Cole
2023-06-11 16:15:40 +02:00
committed by GitHub

View File

@@ -229,7 +229,7 @@ class AttachmentHelper implements AttachmentHelperInterface
if ($model instanceof PiggyBank) { if ($model instanceof PiggyBank) {
$count = $model->account->user->attachments()->where('md5', $md5)->where('attachable_id', $model->id)->where('attachable_type', $class)->count(); $count = $model->account->user->attachments()->where('md5', $md5)->where('attachable_id', $model->id)->where('attachable_type', $class)->count();
} }
if ($model instanceof PiggyBank) { if (!($model instanceof PiggyBank)) {
$count = $model->user->attachments()->where('md5', $md5)->where('attachable_id', $model->id)->where('attachable_type', $class)->count( $count = $model->user->attachments()->where('md5', $md5)->where('attachable_id', $model->id)->where('attachable_type', $class)->count(
); // @phpstan-ignore-line ); // @phpstan-ignore-line
} }