Skip to content

Commit 42ae72e

Browse files
committed
Fix a PHP error being thrown on a Magento error being thrown
1 parent 3f697e0 commit 42ae72e

File tree

1 file changed

+5
-5
lines changed
  • app/code/Magento/MediaStorage/Model/File/Storage

1 file changed

+5
-5
lines changed

app/code/Magento/MediaStorage/Model/File/Storage/File.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -291,16 +291,16 @@ public function saveFile($file, $overwrite = true)
291291
&& isset($file['content'])
292292
&& !empty($file['content'])
293293
) {
294-
try {
295-
$filename = isset(
296-
$file['directory']
297-
) && !empty($file['directory']) ? $file['directory'] . '/' . $file['filename'] : $file['filename'];
294+
$filename = isset(
295+
$file['directory']
296+
) && !empty($file['directory']) ? $file['directory'] . '/' . $file['filename'] : $file['filename'];
298297

298+
try {
299299
return $this->_fileUtility->saveFile($filename, $file['content'], $overwrite);
300300
} catch (\Exception $e) {
301301
$this->_logger->critical($e);
302302
throw new \Magento\Framework\Exception\LocalizedException(
303-
__('Unable to save file "%1" at "%2"', $file['filename'], $file['directory'])
303+
__('Unable to save file "%1" at "%2"', $file['filename'], $filename)
304304
);
305305
}
306306
} else {

0 commit comments

Comments
 (0)