Skip to content

Commit 672c62a

Browse files
authored
Merge pull request #797 from bakaphp/hotfix-filesystem-attachment
2 parents 8a26788 + 43f25cb commit 672c62a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Contracts/FileSystemModelTrait.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,17 @@ protected function associateFileSystem() : bool
3737
continue;
3838
}
3939

40-
if ($fileSystem = FileSystem::getById($file['filesystem_id'])) {
40+
41+
try {
42+
$fileSystem = FileSystem::getById($file['filesystem_id']);
4143
$this->attach([[
4244
'id' => $file['id'] ?? 0,
4345
'file' => $fileSystem,
4446
'field_name' => $file['field_name'] ?? '',
4547
'is_deleted' => $file['is_deleted'] ?? 0
4648
]]);
49+
} catch (Exception $e) {
50+
continue;
4751
}
4852
}
4953
}

0 commit comments

Comments
 (0)