diff --git a/src/Application/FileSystem/RemovedAndAddedFilesCollector.php b/src/Application/FileSystem/RemovedAndAddedFilesCollector.php index 43288ecf029..ee71783cd20 100644 --- a/src/Application/FileSystem/RemovedAndAddedFilesCollector.php +++ b/src/Application/FileSystem/RemovedAndAddedFilesCollector.php @@ -36,8 +36,13 @@ final class RemovedAndAddedFilesCollector public function isFileRemoved(SmartFileInfo $smartFileInfo): bool { + if ($this->removedFileInfos === []) { + return false; + } + + $pathname = $smartFileInfo->getPathname(); foreach ($this->removedFileInfos as $removedFileInfo) { - if ($removedFileInfo->getPathname() !== $smartFileInfo->getPathname()) { + if ($removedFileInfo->getPathname() !== $pathname) { continue; }