Skip to content

Commit

Permalink
Don't throw exception if old preview image can't be removed
Browse files Browse the repository at this point in the history
  • Loading branch information
aimeos committed Oct 26, 2017
1 parent ee60dad commit 1edd981
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions controller/common/src/Controller/Common/Media/Standard.php
Expand Up @@ -480,9 +480,13 @@ protected function storeFile( $content, $fsname, $filepath, $oldpath )
{
$fs = $this->context->getFilesystemManager()->get( $fsname );

if( $oldpath !== '' && $oldpath !== $filepath && $fs->has( $oldpath ) ) {
$fs->rm( $oldpath );
try
{
if( $oldpath !== '' && $oldpath !== $filepath && $fs->has( $oldpath ) ) {
$fs->rm( $oldpath );
}
}
catch( \Aimeos\MW\Filesystem\Exception $e ) {} // continue if removing file fails

$fs->write( $filepath, $content );
}
Expand Down

0 comments on commit 1edd981

Please sign in to comment.