Skip to content

Commit fd6f127

Browse files
ggottwaldfabpot
authored andcommitted
[Finder] no PHP warning on empty directory iteration
1 parent 2716347 commit fd6f127

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Iterator/RecursiveDirectoryIterator.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@ public function isRewindable()
137137
return $this->rewindable;
138138
}
139139

140+
if ('' === $this->getPath()) {
141+
return $this->rewindable = false;
142+
}
143+
140144
if (false !== $stream = @opendir($this->getPath())) {
141145
$infos = stream_get_meta_data($stream);
142146
closedir($stream);

0 commit comments

Comments
 (0)