TemporaryLocalFileStorage: Fix unexpected crash in destructor

This commit is contained in:
Yonas Habteab 2023-01-16 11:54:21 +01:00 committed by Johannes Meyer
parent e542982de0
commit 6d2a585de9

View File

@ -28,6 +28,12 @@ class TemporaryLocalFileStorage extends LocalFileStorage
*/
public function __destruct()
{
// Some classes may have cleaned up the tmp file, so we need to check this
// beforehand to prevent an unexpected crash.
if (! @realpath($this->baseDir)) {
return;
}
$directoryIterator = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator(
$this->baseDir,