Skip to content

Commit

Permalink
fix return none when bool expected
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-kl1 committed Feb 26, 2021
1 parent 8df6c2c commit dd4200b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions Model/Document/Helper/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,12 @@ public function deleteFile(string $filePath): bool
{
try {
$directoryWrite = $this->filesystem->getDirectoryWrite(DirectoryList::MEDIA);
if ($filePath && $directoryWrite->isFile($filePath)) {
return $directoryWrite->delete($filePath);
}
return $filePath && $directoryWrite->isFile($filePath) && $directoryWrite->delete($filePath);
} catch (FileSystemException $e) {
$this->logger->error($e->getLogMessage(), $e->getTrace());

return false;
}

return false;
}

private function resolveFileSubPath(DocumentTypeInterface $documentType, string $fileName): string
Expand Down

0 comments on commit dd4200b

Please sign in to comment.