mirror of
https://github.com/danog/file.git
synced 2024-11-26 11:54:54 +01:00
Fix scandir on empty directory in UvDriver
This commit is contained in:
parent
e037235b9b
commit
04f047aec6
@ -453,8 +453,10 @@ class UvDriver implements Driver
|
||||
$this->poll->listen($deferred->promise());
|
||||
|
||||
\uv_fs_readdir($this->loop, $path, 0, function ($fh, $data) use ($deferred, $path) {
|
||||
if (empty($fh)) {
|
||||
if (empty($fh) && $data !== 0) {
|
||||
$deferred->fail(new FilesystemException("Failed reading contents from {$path}"));
|
||||
} elseif ($data === 0) {
|
||||
$deferred->resolve([]);
|
||||
} else {
|
||||
$deferred->resolve($data);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user