1 parent 7cdf058 commit 4683c45Copy full SHA for 4683c45
1 file changed
Component/Categories.php
@@ -137,8 +137,11 @@ public function createOrUpdateCategory(
137
$value = BP . '/' . trim((string) $value, '/');
138
}
139
140
- if (!$this->driver->copy($value, $catMediaDir . $img)) {
141
- $this->log->logError('Failed to find image: ' . $value, 1);
+ try {
+ $this->driver->createDirectory($catMediaDir);
142
+ $this->driver->copy($value, $catMediaDir . $img);
143
+ } catch (FileSystemException $e) {
144
+ $this->log->logError('Failed to copy image "' . $value . '": ' . $e->getMessage(), 1);
145
break;
146
147
0 commit comments