Skip to content

Commit 365ef45

Browse files
committed
prevent removing the tmp folder if export is empty
1 parent f3f5c6c commit 365ef45

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Model/ExportEntityRepository.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,9 @@ public function getList(SearchCriteriaInterface $searchCriteria): SearchResultsI
160160
public function delete(ExportEntityInterface $exportEntity): bool
161161
{
162162
try {
163-
$this->fileSystem->getDirectoryWrite(DirectoryList::TMP)->delete($exportEntity->getFilePath());
163+
if ($exportEntity->getFilePath()) {
164+
$this->fileSystem->getDirectoryWrite(DirectoryList::TMP)->delete($exportEntity->getFilePath());
165+
}
164166
$this->remove($exportEntity);
165167
$this->exportEntityResource->delete($exportEntity);
166168
} catch (Exception $e) {

0 commit comments

Comments
 (0)