Skip to content

Commit 9af2e9a

Browse files
committed
Prevent crash in case of non-existing file
1 parent 40455c3 commit 9af2e9a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Analyser/ResultCache/ResultCacheManager.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,10 @@ public function restore(array $allAnalysedFiles, bool $debug, Output $output, ?s
9898

9999
$cacheFilePath = $this->cacheFilePath;
100100
if ($resultCacheName !== null) {
101-
$cacheFilePath = $this->tempResultCachePath . '/' . $resultCacheName . '.php';
101+
$tmpCacheFile = $this->tempResultCachePath . '/' . $resultCacheName . '.php';
102+
if (is_file($tmpCacheFile)) {
103+
$cacheFilePath = $tmpCacheFile;
104+
}
102105
}
103106

104107
if (!is_file($cacheFilePath)) {

0 commit comments

Comments
 (0)